RAND Function in Excel

For example, when we type =RAND(), it generates a number like 0.902158.

You are free to use this image on you website, templates, etc., Please provide us with an attribution linkHow to Provide Attribution?Article Link to be HyperlinkedFor eg:Source: RAND Excel Function (wallstreetmojo.com)

RAND Formula Excel and Explanation

The RAND function is categorized as Math and the Trigonometry function in Excel. It returns a random number between 0 and 1. The RAND function in Excel will generate a new random number each time your Excel sheet is refreshed.

The RAND formula in Excel has no parameter; return a random number in Excel that is greater than or equal to 0 and less than 1.

How to Use RAND in Excel?

The RAND function is very simple and easy to use. Let us understand the working of the Excel RAND function in some examples. It can be used as a worksheet functionWorksheet FunctionThe worksheet function in VBA is used when we need to refer to a specific worksheet. When we create a module, the code runs in the currently active sheet of the workbook, but we can use the worksheet function to run the code in a particular worksheet.read more and as a VBA function.

Excel RAND function as a worksheet function.

Example #1

Let us consider the RAND () function to calculate the random numbers between 0 and 1. Then, the Excel RAND function returns the random numbers between 0 and 1, as shown in the table below.

Example #2

As you know, the RAND formula in Excel generates random numbers between 0 and 1. But, using the following RAND formula in Excel, you can use RAND ()to return random numbers between 0 and 100.

Ex. =100*RAND () here RAND in Excel generates random numbers Excel between 0 and 1. Then, the output will multiply by 100 and get the digits between 0 and 100. Finally, it will generate the random number in Excel, as shown below the table.

Example #3

If you want to calculate the random number in Excel between two numbers, use the following RAND formula in Excel.

=a+ (b-a)*RAND (), where a and b may be any numbers.

The RAND formula generates the random number between two integers using the RAND () in Excel.

Example – The Random number excelRandom Number ExcelWe use random numbers in Excel when we wish to generate absolutely random random numbers to randomize our data for a sample evaluation, . In Excel, there are two built-in functions that offer us random numbers in cells: the =RAND() function provides us any value from 0 to 1, and the =RANDBETWEEN() function takes user input for a random number range.read more between 5 and 10 using RAND () formula =5 + (10 – 5) * RAND ().

Example #4

If you want to generate the random numbers between 5 and 10, you can use the RAND() =5 + (10 – 5) * RAND (). It will give the random number between 5 and 10, then apply the INT () function to round the output integer to the nearest positive integer.

Example #5

The RAND function also generates random time. So, you must 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)

End Sub

In this example, the variable called RandomNumber would now contain a random number between 50 and 100.

Things to Remember

  • The RAND () function in Excel calculates a new value each time the worksheet is calculated. To overcome this problem, we must convert the generated value to values.To stop the auto change RAND () function in Excel value, we must go to the go-to RAND formula Excel bar and press F9 to convert the RAND formula in Excel into its result.To generate a set of random numbers in multiple cells, we must select the cells, enter RAND (), and then press the “Ctrl + Enter” keys.To calculate the random numbers between two numbers, we must use the following RAND formula Excel =a+ (b-a)*RAND ().

This article is a guide to RAND Function in Excel. Here, we discuss the RAND formula in Excel and how to use the RAND Excel function, along with Excel examples and downloadable Excel templates. You may also look at these useful functions in Excel: –

  • Random Numbers in VBARandom Numbers In VBATo generate random numbers in vba we have an inbuilt function called RND. It just takes two numbers as input to generate random between these numbers. It creates random numbers which are greater than 0 and smaller than 1.read moreRand FormulaRand FormulaThe RAND function in Excel, also known as the random function, generates a random value greater than 0 but less than 1, with an even distribution among those numbers when used on multiple cells. read moreRandomize List in Excel sheetRandomize List In Excel SheetRandomizing a list in excel means selecting a random value from the data, to randomize a whole list in excel. There are two excel formulae for this: the =RAND() function, which returns any random value to the cell and then allows us to sort the list, and the =RANDBETWEEN() function, which returns random values to the cell from a number range specified by the user.read moreRIGHT Function in ExcelVLOOKUP WildcardVLOOKUP WildcardWildcard Characters are used with the VLOOKUP function to avail the lookup value by only using the partial match. It helps make VLOOKUP more powerful & avoids the #N/A Error. read more