Rand between
Syntax:¶
RANDBETWEEN(bottom, top)
- bottom: The smallest integer value that can be returned.
- top: The largest integer value that can be returned.
Description:¶
The RANDBETWEEN function returns a random integer between the specified bottom and top values (inclusive). It is
often used when you need random whole numbers within a defined range.
Examples:¶
-
=RANDBETWEEN(1, 10):- Returns a random integer between
1and10.
- Returns a random integer between
-
=RANDBETWEEN(50, 100):- Returns a random integer between
50and100.
- Returns a random integer between
-
=RANDBETWEEN(-10, 10):- Returns a random integer between
-10and10.
- Returns a random integer between
-
=RANDBETWEEN(0, 0):- Always returns
0because bothbottomandtopare the same.
- Always returns
-
=RANDBETWEEN(-5, -1):- Returns a random integer between
-5and-1.
- Returns a random integer between
Note: The
RANDBETWEENfunction recalculates its value each time the worksheet changes or is recalculated. To freeze the random value, copy the cell and paste it as a static value.