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:

  1. Select the random numbers
  2. Copy the formulas to the clipboard with Control + C.
  3. Open the Paste Special Window and select “Values”
  4. Click OK to replace the formulas with static values.

Notes

  1. The RAND function can generate random decimal values.
  2. The RANDARRAY function (new in Excel 365 ) can generate random numeric arrays.

Explanation

The CHOOSE function does most of the work in this formula. Choose takes a single numeric value as its first argument (index_number), and uses this number to select and return one of the values provides as subsequent arguments, based on their numeric index.

In this case, we are providing four numbers as options: 25,50,75,100, so we need to give CHOOSE a number between 1 and 4.

To generate this number, we use RANDBETWEEN, a function that returns a random integer based on a lower and upper bound. Since we are only working with 4 values in CHOOSE, we supply 1 for the bottom number and 4 for the top number.

When this formula is copied down, it will return one of the four numbers.

Note that RANDBETWEEN will calculate a new value whenever the worksheet is changed. Once you have values in the range, you may want to replace the formulas with values to prevent further changes. You can do this with paste special: select all formulas, copy, the paste special > values to replace formulas with values.