Excel RANDBETWEEN Function
If you want to follow along with this tutorial, please download the example spreadsheet.
Description
The Excel RANDBETWEEN function returns a random integer number between two given numbers. The result includes the two given numbers. Every time RANDBETWEEN function returns a new random number when the worksheet is changed or opened.
Syntax and arguments
Formula syntax
Arguments
|
Return Value
The RANDBETWEEN function returns to an integer number.
Errors
#NUM! error value occurs when argument bottom > top.
#VALUE! error value occurs when any arguments in the function are non-numeric.
Remarks
1. The RANDBETWEEN function calculates a new result when the worksheet is changed, if you want to stop the result changing, copy and paste the result as a value only to convert it to a static result.
2. If you want to use the random number which is returned by RANDBTWEEN function into other formulas, to stop the result changed by pressing Enter key, you can use F9 key first and then press Enter key to get the result, it will change the formula result to a static value.
3. RANDBETWEEN function returns an integer >= bottom, and <=top.
Version
Excel 2003
Usage and Examples
Example1: basic usage
To get a random integer number between two values, supposing between 1 and 100, please select a cell and type the formula:
=RANDBETWEEN(1,100)
Press Enter key to get the random number.
Example 2: get random integer numbers in a selected ranges
If you want to get random numbers in a selected range at once time, please select a range, and type the RANDBETWEEN function in Formula Bar, then hold Ctrl and press Enter key.
Relative Functions:
Excel RAND Function
The RAND function returns a random number between 0 and 1.
Excel FACTDOUBLE Function
The FACTDOUBLE function returns the double factorial of a given number. For example, FACTDOUBLE(5)=15, equivalent 5 x 3 x 1.
Excel FLOOR Function
The FLOOR function rounds a given number down to the nearest multiple of the specified significance.
Excel FLOOR.MATH Function
The Excel FLOOR.MATH function rounds a given number down to the nearest integer or nearest multiple of the specified significance.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...
Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)
- One second to switch between dozens of open documents!
- Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
- Increases your productivity by 50% when viewing and editing multiple documents.
- Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.