RAND Function in Excel
RAND function in excel is also known as the random function in excel, this formula generates a random value which is greater than 0 but is lesser than 1 and the distribution is even among those numbers if used on multiple cells, the important thing to remember is that when we recalculate the formula the result changes.
RAND Formula Excel and Explanation
RAND function is categorized as Math, or Trig function in excel returns a random number excel between 0 and 1. RAND in excel will generate a new random number excel each time your excel sheet refreshed.
RAND Formula excel has no parameter; just return a random number excel that is greater than or equal to 0 and less than 1.
How to Use RAND in Excel?
RAND function is very simple and easy to use. Let us understand the working of Excel RAND function in some examples. It can be used as a worksheet function and as a VBA function.
Excel RAND function as a worksheet function.
Let’s consider RAND () function in Excel to calculate the random numbers b/w 0 and 1. Excel RAND Function is used to return the random numbers between 0 and 1, as shown in the below table.
As you know, the RAND formula in Excel is used to generate random numbers b/w 0 and 1 only, but you can use RAND () in Excel to return random numbers b/w 0 and 100 by using the following RAND formula excel.
Ex. =100*RAND () here RAND in Excel generates random number excel b/w 0 and 1; then, the output will multiple by 100 gets the numbers b/w 0 and 100. It will generate the random number excel, as shown below the table.
If you want to calculate the random number excel between two numbers, you can use the following RAND formula Excel.
=a+ (b-a)*RAND (), where a and b may be any numbers.
RAND formula Excel generates the random number b/w two integers using RAND () in Excel.
Example – Random number excel between 5 and 10 using RAND () formula in Excel =5 + (10 – 5) * RAND ().
If you want to generate the random numbers b/w 5 and 10, you can use the RAND() =5 + (10 – 5) * RAND () it will give to the random number b/w 5 and 10 then apply INT () function on it to round the output integer to nearest positive integer.
Rand Function also generates random time; you just need to apply the RAND () and then change the cell format to time only.
Excel RAND Function can be used as a VBA function.
Dim RandomNumber As Integer
RandomNumber = Int ((100 – 50 + 1) * Rnd + 50)
In this example, the variable called RandomNumber would now contain a random number excel between 50 and 100.
Things to Remember
- RAND () function in Excel calculates a new value each time the worksheet is calculated. To overcome this problem, you just need to convert the generated value to values.
- To stop the auto change RAND () function in Excel value, you just need to the go-to RAND formula excel bar and then press F9 to convert the RAND formula Excel into its result.
- If we wish to generate a set of random numbers in multiple cells, you just need to select the cells and enter RAND () and then press Ctrl + Enter.
- If you want to calculate the random numbers between two numbers, you can use the following RAND formula Excel =a+ (b-a)*RAND ()
This has been a guide to RAND Function in Excel. Here we discuss the RAND Formula excel and how to use the RAND Excel function along with excel example and downloadable excel templates. You may also look at these useful functions in excel –