RAND function: Description, Usage, Syntax, Examples and Explanation
What is RAND function in Excel?
RAND function is one of the Math and Trig functions in Microsoft Excel that returns an evenly distributed random real number greater than or equal to 0 and less than 1. A new random real number is returned every time the worksheet is calculated.
Syntax of RAND function
RAND()
The RAND function syntax has no arguments.
RAND formula explantion
- To generate a random real number between a and b, use:
=RAND()*(b-a)+a
- 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. The formula will calculate and leave you with just a value.
Example of RAND function
Steps to follow:
1. Open a new Excel worksheet.
2. Copy data in the following table below and paste it in cell A1
Note: For formulas to show results, select them, press F2 key on your keyboard and then press Enter.
You can adjust the column widths to see all the data, if need be.
Formula | Description | Result |
=RAND() | A random number greater than or equal to 0 and less than 1 | varies |
=RAND()*100 | A random number greater than or equal to 0 and less than 100 | varies |
=INT(RAND()*100) | A random whole number greater than or equal to 0 and less than 100 | varies |
Note: When a worksheet is recalculated by entering a formula or data in a different cell, or by manually recalculating (press F9), a new random number is generated for any formula that uses the RAND function. |