Overview
Syntax | RAND() | Returns an evenly distributed random number greater than or equal to 0 and less than 1. A new random number is returned every time the worksheet is calculated. |
Notes
No parameter is required in the function.
To generate a random number between a and b, you can use RAND()*(b-a)+a.
To generate a random number greater than or equal to 0 and less than 60, you can use RAND()*60.
To generate a random number greater than or equal to 0 and less than 19, you can use RAND()*19.
Example
For example, the following figure shows how to return an evenly distributed random number greater than or equal to 0 and less than 1.
The following table describes more examples.
Formula | Result | Note |
---|---|---|
RAND()*60 | Generates a random number greater than or equal to 0 and less than 60. | |
RAND()*19 | Generates a random number greater than or equal to 0 and less than 19. | |
RAND()*50 | Generates a random number greater than or equal to 0 and less than 50. |