RANDBETWEEN Excel Formula

What Does RANDBETWEEN Do in Excel?

RANDBETWEEN is the excel formula that can generate random numbers between two numbers. This is a volatile function and keeps changing when any changes occur in the worksheet.

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

Once the bottom & top numbers provided, it will generate numbers between these two numbers. For example, if the bottom number is 10 and the top number is 20, then the RANDBETWEEN formula will generate numbers between 10 & 20. Numbers are positive integers.

RANDBETWEEN Excel Formula

You are free to use this image on your website, templates etc, Please provide us with an attribution linkHow to Provide Attribution?Article Link to be Hyperlinked
For eg:
Source: RANDBETWEEN Excel Formula (wallstreetmojo.com)

Examples to use RANDBETWEEN Formula in Excel

You can download this RANDBETWEEN Function Excel Template here – RANDBETWEEN Function Excel Template

Example #1

Let’s start with a simple example.

  1. Open the RANDBETWEEN function in the cell in a worksheet.


    randbetween example 1.1

  2. Enter the bottom number as 10 and the top number as 30.


    randbetween example 1.2

  3. Close the bracket and hit the enter key to get the random number between 10 and 30.

    randbetween example 1.3

  4. We got 20 as the answer, perform some other activity in excel; it will change the number to a different one.

    randbetween exampl 1.4

Since it is a volatile function, it keeps changing every time when something happens in the worksheet.

Example #2

We can generate random numbers in multiple cells at a single shot as well. First, select the range of cells that we need to generate random numbers in excel.

randbetween example 2.1

Now open the RANDBETWEEN formula.

randbetween example 2.2

Supply bottom number and top number.

randbetween example 2.3

Close the bracket but do not simply hit the ENTER key; rather, hit CTRL + ENTER to insert random numbers in the selected cells.

RANDBETWEEN GIF 1

Example #3 – Generate Decimal Numbers

Just to inform you excel RANDBETWEEN formula can insert only positive & negative integer numbers. If any of the bottom and top numbers infraction, then excel automatically converts the number to the nearest integer value.

randbetween example 3.1

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 I told, the RANDBETWEEN function can generate only integer numbers, not fraction numbers. In order to generate fraction numbers, we need to multiply the value using the RAND function.

randbetween example 3.2

RAND function generates numbers that are greater than 0 and less than 1. 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

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

We need to enclose the CHAR function in excel with RANDBETWEEN.

Example 4

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

Number 65 is equal to “A”; number 66 is equal to “B” and so on.

Example #5 – Generate Random Dates

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

Step 1: Open the DATE function first.

Example 5

Step 2: The first argument is YEAR, for this open RANDBETWEEN formula and supply years as 2015, 2018.

Example 5.1

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

Example 5.2

Step 4: The last parameter of the DATE function in excel is DAY, for this supply numbers from 1 to 31 for excel RANDBETWEEN function.

Example 5.3

Now hit Ctrl + Enter, we will get random dates in a selected range of cells.

RANDBETWEEN GIF 2

Things to Remember

  • RANDBETWEEN is a volatile function.
  • It keeps changes result if any activity is done in the worksheet.
  • If the bottom number is more than the top number, we will get #NUM! Error.
  • RANDBETWEEN can generate only integer numbers.
  • A combination of RANDBETWEEN & RAND function in excel can give fraction numbers.
  • Since RANDBETWEEN is a volatile function, it may slow down your workbook when the data increases.

Recommended Articles

This has been a guide to RANDBETWEEN in Excel. Here we discuss how to use the RANDBETWEEN function in excel along with examples and a downloadable template. You can learn more about excel functions from the following articles –

  • 35+ Courses
  • 120+ Hours
  • Full Lifetime Access
  • Certificate of Completion
LEARN MORE >>