RAND Function (Table of Contents)
RAND in Excel
Rand function in excel generates random numbers. As the name of the function is RAND which is used in short for Random value, RAND function generates the values which are between 0 and 1 only. The important thing about RAND function is the generated value by this function always generates a unique value which is never repeated in the same iterations.
RAND Formula in excel:
Below is the RAND Formula:
This function does not include any of the arguments rather it assumes numbers greater than or equal to zero but less than 1. Unlike the RANDOMBETWEEN function, we need not to specify the bottom value and top value to the RAND function. The range of these numbers varies from between 0 and 0.99999999…
As an analyst and excel trainer it always a handy function to generate some quick numbers to teach my students. However, it is not a most used formula in corporate offices because the need of RAND function may not arise at all for somebody in the office.
How to Use the RAND Function in Excel?
This function is very simple and easy to use. Let us now see how to use the RAND Function with the help of some examples.
As a trainer to teach SUM function to my students, I need to generate some numbers from 0 to less than 1. I quickly do that with the RAND function.
Here I have generated numbers from A2 to E17 and applied the SUM formula for each column in row 18. SUM is taking the range as A2:A17, B2:B17, and so on until E2:E17.
The Answer I got is mentioned in the below image.
Assume you are running a lottery shop and you need to assign some of the numbers against each lottery ticket and select only the numbers greater than 0.95.
Now, we need to generate numbers and chose the winner. Let us go ahead and apply the RAND function to generate numbers.
Now we have generated random numbers in column C.
Now we need to find the winner and the criteria are if the RAND number is greater than 0.95 then they will be declared as the winner.
Now, again we need to apply one more formula to get this done and declare the winner. We need to use the IF condition to declare the winner.
What IF condition doing here is it is testing whether the values in column C are greater than or equal to zero and if that logical test is true.
Then it will return the result as Winner. In the above table, the winner is Rihu Since her score is greater than 0.95 so the formula declared her as the Winner.
If the logical result is false
Then it will return the result as Better Luck Next Time.
Using this function we can generate numbers that less than 1. What if we want to generate an integer number less than 100. In order to generate random numbers from 10 to 100, we need to use the function INT to get the numbers that are full numbers i.e. no decimals in place.
Here INT function eliminates the decimal places and our highest value is 100 and our lowest value is 10.
Things to Remember
- It is one of the many volatile functions in excel. It keeps varying if there are any cell value changes within the excel worksheet.
- Since it is a volatile function, it may reduce the speed of the workbook.
- Turn off auto calculation in excel to avoid volatile changes in the formula.
- It is a useful formula to use when you want to generate random percentages from 0% to 100%.
- Use the ey to change the RAND from formula to value. Edit the formula and press F9.
- You need to do the paste special option to eliminate the volatility of the function. Copy the data and paste it as values only.
- If you want to generate the two random, numbers use the RANDOMBETWEEN formula, which requires both the bottom value and the highest value in a single formula.
This has been a guide to RAND Function. Here we discuss the RAND Formula and how to use RAND Function along with practical examples and downloadable excel templates. You can also go through our other suggested articles –