- Applies to: Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel for the web, Excel 2019, Excel 2016, Excel 2019 for Mac, Excel 2013, Excel 2010, Excel 2007, Excel 2016 for Mac, Excel for Mac 2011, Excel Starter 2010.
This post will teach you all about using the RAND function in Excel. Firstly, we will delve into the meaning of this function. Secondly, we will take a look at how the formula is structured. Then, we will explore the vital conditions to consider when using the RAND function in Excel. Finally, there is an example for you to play around with and see how the RAND function works.
What is the RAND Function?
The RAND function is a mathematical function which simply returns an evenly distributed random genuine number greater than or equal to 0 and below 1. A new random real number is captured each time the worksheet is calculated.
Note: From Excel 2010 onwards, Excel applies the Mersenne Twister algorithm (MT19937) to create random numbers.
Syntax of the RAND Function
Unlike other formulas, the RAND function syntax contains absolutely no arguments.
Remarks of the RAND Function
- To produce a random real number between a and b, use:
- If you are looking to deploy RAND to create a random number but prefer not to have the numbers refresh each time the cell is calculated, you can type =RAND() in the formula bar, and then press F9 to modify the formula to a random number. Subsequently, the formula will calculate and leave you with only a value.
Example of the RAND Function
Copy the sample data included in the table underneath, and paste it into cell A1 of a completely new Excel worksheet. For formulas to indicate results, choose them, press F2, and then press Enter. Often, you may need to amend the column widths to gain a full view of the entire dataset in all its glory!
|=RAND()||A random number greater than or equal to 0 and less than 1||varies|
|=RAND()*100||A random number greater than or equal to 0 and less than 100||varies|
|=INT(RAND()*100)||A random whole number greater than or equal to 0 and less than 100||varies|
|Note: When a worksheet is recalculated by writing a formula or data in another cell, or by manually recalculating (press F9), a new random number is materialised for any formula that employs the RAND function.|