RANDBETWEEN
The RANDBETWEEN function generates a random integer between two specified values. It is useful for tasks like random selection or simulation. Common applications include creating test data or simulating outcomes.
Syntax 🔗
=RANDBETWEEN(Bottom
, Top
)
Bottom | The lower boundary of the range from which the random number will be selected. |
Top | The upper boundary of the range from which the random number will be selected. |
About RANDBETWEEN 🔗
Use the RANDBETWEEN function to generate a random integer between two specified numbers in Excel. Simply set the lower and upper bounds to get a random number within that range. This can be useful for selecting random items, creating test data, or adding variability to your models and simulations.
Examples 🔗
To simulate the rolling of a fair 6-sided die in Excel, use the RANDBETWEEN function with Bottom as 1 and Top as 6. Enter the formula: =RANDBETWEEN(1, 6). Each time the sheet recalculates, it generates a random integer between 1 and 6.
If you need to assign random group numbers to a list of students, set Bottom as 1 and Top as the total number of groups. Enter the formula: =RANDBETWEEN(1, total_groups). This allocates random group numbers each time the sheet recalculates.
Notes 🔗
The RANDBETWEEN function recalculates each time your worksheet is modified or formulas are refreshed, providing a new random number. Set appropriate boundaries to define the range of random integers you need for your scenario.
Questions 🔗
The RANDBETWEEN function generates a random integer between the specified bottom and top values, whereas the RAND function produces a random decimal number between 0 and 1. If you need a discrete random integer, RANDBETWEEN is the preferred choice.
Can I use non-integer values with the RANDBETWEEN function?No, the RANDBETWEEN function specifically generates random integer numbers within the defined range. For random decimal numbers, utilize the RAND function in Excel.
Is the range specified in the RANDBETWEEN function inclusive?Yes, the RANDBETWEEN function includes both the bottom and top values in the range. Therefore, the random number generated can be equal to the bottom and top boundaries as well.