RAND function
The RAND function generates a random decimal number between 0 and 1, for example, RAND will generate a number like 0.857519619. A new random number is generated every time the worksheet is calculated, hence, if you don’t want the number to change each time the worksheet is calculated you have to keep only the value generated and not the formula.
You can enter =RAND() in the formula bar, and then press F9 to generate a random value only without the formula entered in the cell. Alternately, you can generate numbers on another part of your worksheet and then copy and paste only the values to the target cells.
Syntax
RAND()
The RAND function has no arguments.
Example
In the example below, we use the RAND function with different combinations to generate numbers in different ranges.
=RAND() - A random number greater than or equal to 0 and less than 1.
=RAND()*1000 - A random number greater than or equal to 0 and less than 1000.
=INT(RAND()*500) - A random whole number greater than or equal to 0 and less than 500.
=RAND()+1 - A random number greater than or equal to 1 and less than 2.
Tip : The RANDBETWEEN function is a much better function for generating numbers within a range of numbers, especially for a large set of random numbers.