ID EN
#Math

RANDBETWEEN

Excel Functions

Get a random integer between two values

Syntax

EXCEL
=RANDBETWEEN(bottom, top)

Arguments

Parameter Description
bottom An integer representing the lower value of the range.
top An integer representing the upper value of the range.

Return Value

An integer

Details

The RANDBETWEEN function returns a random integer between two numbers. The result from RANDBETWEEN is automatic, and a new random number will be recalculated each time a worksheet is opened or changed. The RANDBETWEEN function takes two arguments: bottom and top. Bottom represents the lower bound for a random number, and top represents the upper bound. RANDBETWEEN includes both top and bottom values in the range of integers that may be returned. Below are basic examples of RANDBETWEEN formulas: To generate multiple random numbers in multiple cells, select the target cells, enter the RANDBETWEEN function, and press control + enter to enter the same formula in all cells at once. RANDBETWEEN returns a new random value each time the worksheet is recalculated, including changes made to unrelate

Examples

Examples

Below are basic examples of RANDBETWEEN formulas:

EXCEL
=RANDBETWEEN(1,9) // random number between 1 and 9
=RANDBETWEEN(10,100) // random number between 10 and 100
=RANDBETWEEN(-10,0) // random number between -10 and zero

See Also

RAND RANDARRAY