This is an overview.
The RAND Function in Excel
This function returns a random number between 0 and 1.
- Syntax
=RAND()
- Arguments
This function doesn’t require any argument.
Example 1 – Generate Random Numbers Between 0 and 1
Use:
=RAND()
5 random numbers were generated.
Example 2 – Generating Random Numbers Between 0 and 100
Use the formula:
=RAND()*100
5 random numbers between 0 and 100 were generated.
Example 3 – Using the RAND Function to Generate Random Numbers Between Two Specific Numbers in Excel
Find random values between two numbers.
=RAND()*(b-a)+a
- Replace a and b in the formula with numbers. The difference between the two numbers is multiplied by the random value generated by the RAND function. The starting number is added to the output.
Random values between 5 and 6 were generated.
Example 4 – Generate Random Integer Numbers
- Use a nested formula:
=INT(RAND())
- To generate numbers between 0 and 100, the formula is:
=INT(RAND()*100)
5 random integers between 0 and 100 were generated.
Example 5 – Use the RAND Function to Generate Random Numbers Up to a specified Decimal in Excel
- To generate numbers up to 2 decimal points, use the formula:
=ROUND(RAND()*100,2)
A random value between 0 and 100 with up to 2 decimal points is generated.
You can select other decimal points:
Practice Workbook
Download the workbook.
<< Go Back to Excel Functions | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!