Examples

RAND takes no arguments:

Automatic recalculation

The RAND function will calculate a new result each time a worksheet is edited. To stop random numbers from being updated, copy the cells that contain RAND to the clipboard, then use Paste Special > Values to convert to a static result. To get a single random number that doesn’t change when the worksheet is calculated, enter =RAND() in the formulas bar and then press F9 to convert the formula into its result.

Multiple random numbers

To generate a set of random numbers in multiple cells, select the cells, enter =RAND() and press control + enter. 

Random number between

To generate a random number between a and b, you can use a formula like this: For example, to generate a random number between 1 and 9: The RANDBETWEEN function can generate random integers between to numbers: Note: In Excel 365, the RANDARRAY function is another way to generate multiple random numbers, and to generate random numbers between two values.

Notes

The RAND function takes no arguments. RAND recalculates whenever a worksheet is opened or changed.

Dave Bruns

Hi - I’m Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.