Excel RANDBETWEEN Function

Using the Excel RANDBETWEEN Function


The RANDBETWEEN function is used to generate a random integer number between two user specified numbers. Similar to the RAND function, a new number is returned each time the worksheet is changed or opened.


=RANDBETWEEN (bottom, top)

Syntax Breakdown

Required. The smallest number that can be returned.

Required. The largest number that can be returned.

Usage Notes

RANDBETWEEN is used to return a random integer between a user specified floor and ceiling number. The output is updated each time the spreadsheet changes or is recalculated. If you don't need to specify the bottom and top values, the RAND function could be used. RAND returns a random number between zero (0) and 1.

Prevent Numbers From Changing
To stop the result of RANDBETWEEN from updating each time the spreadsheet is changed, copy the value returned and Paste Special as Values. This converts the result to text so that it is no longer a function and won't update each time a change takes place.

It is also possible to enter the RANDBETWEEN function in the formula bar and press F9 to convert the function into the result.