Syntax. RAND()
Definition. This function returns a random number between 0 and 1 with up to 16 decimal places.
Arguments. None
Background. The RAND() function returns a random number greater than or equal to 0 and less than 1.
To generate a random real number between a and b, use:
=RAND() • (b-a)+a
A new random number is returned every time the worksheet is calculated.
Example. The RAND() function is often used to fill a table with test data or to simulate processes in engineering and natural sciences. The formula has to be entered in each cell.
If you want to use RAND() to generate a random number but don’t want the numbers to change every time the cell is calculated, you can enter =RAND() in the formula bar and then press F9 to change the formula to a random number.
To copy multiple cells containing a formula for random numbers, click the right mouse button in the same range and select Paste Special/Values.
Examples. Some examples of this function are:
=RAND() • (100-1)+1
returns a random number between 1 and 100.
=RAND() • (250-150)+150
returns a random number between 150 and 250.
Sample Files
Use the RAND worksheet in the Chapter16.xls or Chapter16.xlsx sample file. The sample files are found in the Chapter16 folder. For more information about the sample files, see the section titled Using the Sample Files
18.226.164.75