Excel RANDBETWEEN Function
If you want to follow along with this tutorial, please download the example spreadsheet.
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
The RANDBETWEEN function returns to an integer number.
#NUM! error value occurs when argument bottom > top.
#VALUE! error value occurs when any arguments in the function are non-numeric.
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.
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:
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.
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.