Generate RANDOM numbers with Excel’s RANDBETWEEN function

Image of software function sign fx

Generate one or multiple random numbers between two values.


=RANDBETWEEN ( Value1, Value2 )

Syntax example – generate a random number between 5 and 250

=RANDBETWEEN ( 5, 250 )

Screenshot of Excel worksheet with RANDBETWEEN function
Method – create ONE random number with RANDBETWEEN
  • Click on a cell to select it, and type the formula into the cell, and press Enter.
Method – create MULTIPLE random numbers with RANDBETWEEN
  • Either create one random number as above, and then click and drag from the right-hand corner of the cell to copy the formula to a range of cells, or
  • First select the range of cells to apply the function to, and press Ctrl-Enter.
Method – create STATIC random numbers with RANDBETWEENsee video below

After using one of the methods above to create random number(s), copy and paste the values into another cell / range.

The numbers created by the RANDBETWEEN function are dynamic — every time the worksheet is refreshed (by updating another cell/formula, or closing and opening the file), the numbers will be regenerated.

Video player icon

The short video below shows how to copy and paste the generated values into another range to make the values static. Note that, when the values are pasted into the new range, the worksheet is refreshed and new values are created by the RANDBETWEEN function in the original cell range.

This short video shows how to copy a set of dynamic values generated by the RANDBETWEEN function, and paste as static values.