Note: The other languages of the website are Google-translated. Back to English

Excel RANDBETWEEN Function

doc workday.intl function 1

If you want to follow along with this tutorial, please download the example spreadsheet.

doc workday.intl function 1


The Excel RANDBETWEEN function returns a random integer number between two given numbers. The result includes the two given numbers. Every time RANDBETWEEN function returns a new random number when the worksheet is changed or opened.

Syntax and arguments

Formula syntax

RANDBETWEEN(bottom, top)


  • Bottom: Required, the smallest integer number in the range of two values.
  • Top: Requied, the largest integer number in the range of two values.

Return Value

The RANDBETWEEN function returns to an integer number.


#NUM! error value occurs when argument bottom > top.

#VALUE! error value occurs when any arguments in the function are non-numeric.


1. The RANDBETWEEN function calculates a new result when the worksheet is changed, if you want to stop the result changing, copy and paste the result as a value only to convert it to a static result.

2. If you want to use the random number which is returned by RANDBTWEEN function into other formulas, to stop the result changed by pressing Enter key, you can use F9 key first and then press Enter key to get the result, it will change the formula result to a static value.

3. RANDBETWEEN function returns an integer >= bottom, and <=top.


Excel 2003

Usage and Examples

Example1: basic usage

To get a random integer number between two values, supposing between 1 and 100, please select a cell and type the formula:


Press Enter key to get the random number.

doc workday.intl function 1

Example 2: get random integer numbers in a selected ranges

If you want to get random numbers in a selected range at once time, please select a range, and type the RANDBETWEEN function in Formula Bar, then hold Ctrl and press Enter key.

doc workday.intl function 1

doc workday.intl function 1

Relative Functions:

  • Excel FACTDOUBLE Function
    The FACTDOUBLE function returns the double factorial of a given number. For example, FACTDOUBLE(5)=15, equivalent 5 x 3 x 1.

  • Excel FLOOR Function
    The FLOOR function rounds a given number down to the nearest multiple of the specified significance.

  • Excel FLOOR.MATH Function
    The Excel FLOOR.MATH function rounds a given number down to the nearest integer or nearest multiple of the specified significance.

The Best Office Productivity Tools

Kutools for Excel - Helps You To Stand Out From Crowd

Would you like to complete your daily work quickly and perfectly? Kutools for Excel brings 300 powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) and save 80% time for you.

  • Designed for 1500 work scenarios, helps you solve 80% Excel problems.
  • Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands.
  • Become an Excel expert in 3 minutes. No longer need to remember any painful formulas and VBA codes.
  • 30-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years.
Ribbon of Excel (with Kutools for Excel installed)

Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

  • One second to switch between dozens of open documents!
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Firefox, And New Internet Explorer.
Screen Shot of Excel (with Office Tab installed)
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations