< Go Back

Random number between two numbers

You often need to return a random number between two numbers for sampling purpose or assigning a random value to a data set. Excel RANDBETWEEN function has a built-in function to perform this task.

Random number between two numbers

Excel RANDBETWEEN function returns a random number between two numbers or between given bottom and top range. It is categorized as Math/Trig Function and it returns new random number each time worksheet recalculates.

Syntax

The syntax of Excel RANDBETWEEN function is:

=RANDBETWEEN(bottom, top)

Arguments

There are two required arguments.

Bottom: It is the smallest integer value specified that the function will return.

Top: It is the largest integer value specified that the function will return.

Returns

Excel RANDBETWEEN function returns a random number between two numbers specified in function as the bottom and top numeric values.

 

Example

For example, you want to generate a random number between two numbers i.e. 1 and 50 in a range of cells A2: A21. You need to insert the formula in cell A2 and drag or copy and paste this formula to cell A21. Excel will return a random number between two numbers specified in the formula, such as;

 

=RANDBETWEEN(1,50)

Figure 1. Random_Between-two-numbers

Notes

Please note that RANDBETWEEN function returns a new random number between two numbers whenever you edit any cell in the range containing formulas or you open the worksheet again. If you want to restrict with an initially generated random number between two numbers then you need to replace the formulas with values in the applied range. Simply, select the range of cells A2:A21, copy the formulas > paste special > and click on values and save.

Our customers love us!
“The expert was absolutely amazing and stuck with me the whole way through. They were polite, patient, seemed to want to genuinely help me and provided a solution that I would never have managed otherwise. I could not be more thankful for their support and solution. Thank you!” - - Chris T, in California
This blog is one way to figure it out. A 20 minute chat session with an expert is a better way.Get step-by-step guidance on your question

Leave a Comment

avatar