Go Back

Excel RAND Function

Excel allows us to get a random decimal number between 0 and 1 by using the RAND function. We will also see how to make the function to return a number in any range. This step by step tutorial will assist all levels of Excel users in getting a random number.

Figure 1. The final result of the RAND Function

Syntax of the RAND Function

=RAND()

The function has no parameters.

Get a Random Decimal Number between 0 and 1

We want to get a random decimal number between 0 and 1

The formula looks like:

=RAND()

To apply the RAND function, we need to follow these steps:

  • Select cell B3 and click on it
  • Insert the formula: =RAND()
  • Press enter

Figure 2. Get a random decimal number between 0 and 1

Every time we press enter in formula cell, we will get a new decimal number in B3.

Get a Random Number between Two Numbers

We can modify the RAND function to make it return a random number between any two numbers. In our example, we want to get a random number between 1 and 100.

The formula looks like:

=RAND() * (100 - 1) + 1

We could put any two numbers in the formula, the generic formula looks like:

=RAND() * (max - min) + min

To apply the formula, we need to follow these steps:

  • Select cell B3 and click on it
  • Insert the formula: =RAND() * (100 - 1) + 1
  • Press enter

Figure 3. Get a random number between 1 and 100

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

Which of the following functions will simulate the rolling of a dice and generate at random numbers from the set of {1,2,3,4,5,6}. Tick all that apply =INT(RAND()*6) =INT(RAND()*6)+1 =RAND()*6 =RAND(6)+1 =INT(RAND()*6+0.5)
Solved by G. S. in 19 mins
Want to set up a translations quiz, using rand between and vlookups, all working fine, except when i go to submit an answer the rand between changes value and makes my answer wrong, have tried a nested if, but circular reference, how can I only get the rand between to change when the answer is correct?
Solved by B. F. in 30 mins
I need help using the RAND function and applying specific conditions
Solved by E. J. in 15 mins

Leave a Comment

avatar