RANDBETWEEN
Description
Returns a random integer between the minimum and maximum values that you specify.
This function is volatile; it generates a new random number any time any cell
changes in the workbook. To generate a random number only when you cause the formula
to run, such as by selecting
, use RANDCONST().
Syntax
RANDBETWEEN(
min
,
max
)
- min: The minimum value.
- max: The maximum value.
Example
Formula | Result |
|---|---|
=RANDBETWEEN(1,5) | varies (between 1 and 5) |
Notes
- The function doesn't run as a volatile function if the Worksheets calculation mode is set toManualin .
- If you need one-time-only calculation, for any formula, enclose it in the ONCE function.
Related Functions
ONCE
RANDCONST