Explanation
The Excel RANDBETWEEN function returns a random integer between given numbers. In the example shown, the formula in B5 is:
=RANDBETWEEN(1,100)
This formula is then copied down from B5 to B11. The result is random numbers between 1-100.
RANDBETWEEN is a volatile function that recalculates when a worksheet is opened or changed. This includes any edits to the worksheet, or simply opening the workbook. To prevent random numbers from being recalculated again, you can replace the formulas with the values last calculated:
- Select the random numbers
- Copy the formulas to the clipboard with Control + C.
- Open the Paste Special Window and select "Values"
- Click OK to replace the formulas with static values.
Notes
- The RAND function can generate random decimal values.
- The RANDARRAY function (new in Excel 365) can generate random numeric arrays.