Exceljet

Quick, clean, and to the point

Excel RANDBETWEEN Function

Excel RANDBETWEEN function
Summary 
The Excel RANDBETWEEN function returns a random integer between given numbers. RANDBETWEEN recalculates when a worksheet is opened or changed.
Purpose 
Get a random integer between two values
Return value 
An integer
Syntax 
=RANDBETWEEN (bottom, top)
Arguments 
  • bottom - An integer representing the lower value of the range.
  • top - An integer representing the upper value of the range.
Version 
Usage notes 

Use the RANDBETWEEN function to get a random integer between bottom and top. For example, =RANDBETWEEN(1,50) might generate the number 28. RANDBETWEEN includes both top and bottom numbers in the range of integers that may be returned. To generate a set of random integers in multiple cells, select the cells, enter the RANDBETWEEN function, and press control + enter.

Note: in Excel 365, the RANDARRAY function is a more flexible alternative. RANDARRAY can generate random decimal numbers and random integers, and can also return more than one random value at the same time.

RANDBETWEEN returns a new integer each time the worksheet is recalculated, including changes to unrelated cells in the same workbook. To stop random numbers from changing, copy the cells that contain RANDBETWEEN to the clipboard, then use Paste Special > Values to convert to text. To get a random number that doesn't change, enter RANDBETWEEN in the formulas bar and then press F9 to convert the formula to a static result.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.