How to Use the RAND Function in Excel – 5 Examples

This is an overview.

excel RAND function


The RAND Function in Excel

This function returns a random number between 0 and 1.

  • Syntax
=RAND()

overview of Excel RAND function

  • Arguments

This function doesn’t require any argument.

Example 1 – Generate Random Numbers Between 0 and 1

Use:

=RAND()

 RAND Function to Generate Random Number Between 0 and 1

5 random numbers were generated.


Example 2 – Generating Random Numbers Between 0 and 100

Use the formula:

=RAND()*100
Generating Random Number Between 0 and 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 number between 5 and 6

Random values between 5 and 6 were generated.

 

Random number between 5 and 6


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)

Random Integer Number Using RAND Function in Excel

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.

random value between 0 to 100 with up to 2 decimal points

You can select other decimal points:

RAND Function to Generate Random Number Up to Desired Decimal

 

 


Practice Workbook

Download the workbook.


 

<< Go Back to Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Shakil Ahmed
Shakil Ahmed

My name’s Shakil. My articles are targeted to support you in enriching knowledge regarding different features related to Microsoft Excel. I am fond of literature, hope some knowledge from them will help me providing you some engaging articles even though some weary technical terms.

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo