Returns a random integer number between the user-specified numbers
Over 1.8 million professionals use CFI to learn accounting, financial analysis, modeling and more. Start with a free account to explore 20+ always-free courses and hundreds of finance templates and cheat sheets.
The RANDBETWEEN Functionis categorized under Excel Math and Trigonometry functions. The function will return a random integer number between the user-specified numbers. It will return a random integer number every time the worksheet is opened or calculated.
As a financial analyst, the RANDBETWEEN function can be used to generate random integer numbers within a specified range. However, it is used less frequently in the finance industry, as compared to other fields such as cryptography and statistics.
The RANDBETWEEN function uses the following arguments:
Bottom (required function) – This is the smallest integer that the function will return.
Top (required function) – This is the largest integer that the function will return.
How to use the RANDBETWEEN Function in Excel?
To understand the uses of the RANDBETWEEN function, let’s consider an example:
When we enter data in the Bottom and Top columns below, we will get different results every time the worksheet is calculated or opened:
The formula used was =RANDBETWEEN(B5,C5).
When we did some recalculations, the worksheet changed the results, as shown below:
Few notes about the RANDBETWEEN Function
RANDBETWEEN will calculate a new value each time the worksheet is calculated. If we wish to stop random numbers from being generated, we need to copy the cells that contain RANDBETWEEN to the clipboard and then use Paste Special > Values to convert them to text.
If we wish to get a random number that will not change when the worksheet is calculated, we need to enter the RANDBETWEEN function in the Formulas bar and then press F9 to convert the formula into its result.
If we wish to generate a set of random numbers in multiple cells, we need to select the cells, enter RANDBETWEEN function and press Ctrl + Enter after.
Thanks for reading CFI’s guide to this important Excel function. By taking the time to learn and master these Excel functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources:
Take your learning and productivity to the next level with our Premium Templates.
Upgrading to a paid membership gives you access to our extensive collection of plug-and-play Templates designed to power your performance—as well as CFI's full course catalog and accredited Certification Programs.
Already have a Self-Study or Full-Immersion membership? Log in
Access Exclusive Templates
Gain unlimited access to more than 250 productivity Templates, CFI's full course catalog and accredited Certification Programs, hundreds of resources, expert reviews and support, the chance to work with real-world finance and research tools, and more.