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 )
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 RANDBETWEEN — see 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.
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.