This page gives examples of how to use the Excel random number generation functions to perform the following random selections:
|Select a Random Decimal Value Between 0 and 1|
|Select a Random Integer Between Two Supplied Integers|
|Select a Random Decimal Between Two Specified Values|
|Select a Random Value From a List|
If you want to generate a random decimal value between 0 and 1, simply used the Excel Rand function by entering the following formula into any cell of your worksheet:
This function will generate a different random decimal, between 0 and 1 every time your worksheet re-calculates.
The Excel Randbetween function is used to generate a random integer between two supplied integers. For example:
generates a random integer between 0 and 10.
If you want to generate a random decimal value between any two values, A and B you can use the following formula (which uses the Excel Rand function):
The following formula generates a random decimal value between the values 5 and 10:
The formula below generates a random decimal value between the values 0.5 and 1.2:
For example, if you want to select a name at random from the values in cells A1 - A8 of the above spreadsheet on the right, this can be done using the following formula:
In the above formula: