What Does RANDBETWEEN Do in Excel?

For example, when we type =RANDBETWEEN(30,40), it generates 33.

  • Bottom: What is the bottom number to generate the number?Top: What is the top number to create a number?

Once the bottom and top numbers are provided, they will generate numbers between them. For example, if the bottom number is 10 and the top number is 20, then the RANDBETWEEN formula will generate numbers between 10 and 20. That is because the numbers are positive integers.

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: RANDBETWEEN Excel Formula (wallstreetmojo.com)

Examples to use RANDBETWEEN Formula in Excel

Example #1

Since it is a volatile function, it keeps changing whenever something happens in the worksheet.

  • Open the RANDBETWEEN function in the cell in a worksheet. Insert the bottom number as 10 and the top number as 30. Close the bracket and press the “Enter” key to get the random number between 10 and 30. We got 20 as the answer and performed some other activities in Excel. So, it will change the number to a different one.

Example #2

We can also generate random numbers in multiple cells at a single shot. First, select the range of cells we need to create random numbers in excelRandom Numbers In 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.

Now, open the RANDBETWEEN formula.

Supply bottom number and top number.

Close the bracket but do not press the “Enter” key. Rather, press the “CTRL + ENTER” keys to insert random numbers in the selected cells.

Example #3 – Generate Decimal Numbers

For information, the Excel RANDBETWEEN formula can insert only positive and negative integer numbers. If any of the bottom and top numbers are fractions, then Excel automatically converts the number to the nearest integer value.

As we can see in the above image, the bottom number is 5.5, and the top number is 15.5. So, Excel automatically converts the bottom number 5.5 to 6 and 15.5 to 16. So, we got the numbers between 6 and 16 in the above image.

As we said, the RANDBETWEEN function can generate only integer numbers, not fraction numbers. Therefore, we must multiply the value using the RAND function to generate fraction numbers.

The RAND function generates numbers greater than 0 and less than 1. Therefore, the value given by the Excel RANDBETWEEN formula will be multiplied by the fraction value given by the RAND function.

Example #4 – Generate Random Alphabets

The RANDBETWEEN function is used not only to generate random numbers but also to generate random alphabets.

We need to enclose the CHAR function in excelCHAR Function In ExcelThe character function in Excel, also known as the char function, identifies the character based on the number or integer accepted by the computer language. For example, the number for character “A” is 65, so if we use =char(65), we get A.read more with RANDBETWEEN.

The RANDBETWEEN function will return numbers from 65 to 90. The CHAR function converts the numbers from 65 to 90 from A to Z.

The number 65 is equal to “A”; the number 66 is equivalent to “B,” and so on.

Example #5 – Generate Random Dates

We have seen how we can use the RANDBETWEEN formula to generate random numbers and alphabets. Now, we will see how we can develop random dates.

Step 1: We must open the DATE function first.

Step 2: The first argument is YEAR. For this, open the RANDBETWEEN formula and supply years like 2015 and 2018.

Step 3: The next argument in the DATE function is MONTH. For this, open the RANDBETWEEN function and supply numbers 1 to 12.

Step 4: The last parameter of the DATE function in excelDATE Function In ExcelThe date function in excel is a date and time function representing the number provided as arguments in a date and time code. The result displayed is in date format, but the arguments are supplied as integers.read more is DAY. For this supply, numbers from 1 to 31 for the Excel RANDBETWEEN function.

Now, press the “Ctrl + Enter” keys. Again, we will get random dates in a selected range of cells.

Things to Remember

  • The RANDBETWEEN Excel function is volatile.It keeps changing the result if any activity is done on the worksheet.If the bottom number exceeds the top, we will get #NUM! Error.The RANDBETWEEN function in Excel can generate only integer numbers.A combination of RANDBETWEEN and RAND function in excelRAND Function In ExcelThe 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 more can give fraction numbers.As the RANDBETWEEN is a volatile function, it may slow down the workbook when the data increases.

This article is a guide to RANDBETWEEN in Excel. Here, we discuss using the RANDBETWEEN function in Excel, examples, and a downloadable template. You can learn more about Excel functions from the following articles: –

  • Randomize List in ExcelVBA Random NumbersVBA Random NumbersTo 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 Excel FormulaRand Excel 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 moreFree Excel Course