Excel RANDBETWEEN Function: Syntax, Examples & Tips

The RANDBETWEEN formula generates random integers within a specified range, aiding in dynamic data analysis and simulations.
Excel
=RANDBETWEEN(bottom, top)

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Need more than a single RANDBETWEEN formula? Try our free AI for Excel — it reads your entire spreadsheet, answers questions in plain English, and builds charts and analysis in the same chat.

On this page
  1. Parameters
  2. What is a RANDBETWEEN Formula in Excel?
  3. A Practical Example
  4. RANDBETWEEN Formula
  5. Result of the Formula
  6. Why Use RANDBETWEEN?
  7. Key Takeaways:
  8. Example use case

Parameters

bottom:
The smallest integer that RANDBETWEEN can return.

top:
The largest integer that RANDBETWEEN can return.

What is a RANDBETWEEN Formula in Excel?

The RANDBETWEEN function in Excel is a handy tool that allows you to generate random integers between two specified numbers. Each time the worksheet recalculates, the function produces a new random number within the defined range, making it useful for simulations, random sampling, and various other applications.

In simpler terms, the RANDBETWEEN function helps you create random numbers in a specified range, which can be useful for various tasks such as creating test data or conducting randomized experiments.

A Practical Example

Imagine you are conducting a survey and need to randomly select participants from a pool of candidates. You have the following data in an Excel spreadsheet:

Candidate Data Table:

Candidate IDName
1Alice
2Bob
3Charlie
4David
5Eve

You want to randomly select a candidate from this list.

RANDBETWEEN Formula

To randomly select a candidate, you would use the RANDBETWEEN formula as follows:

Excel
=RANDBETWEEN(1, 5)

Breakdown of the Formula:

  • 1: This is the lower bound of the range (the minimum value).
  • 5: This is the upper bound of the range (the maximum value).

Result of the Formula

When you apply the formula, it generates a random integer between 1 and 5. For example, if the output is 3, it corresponds to the candidate Charlie.

Randomly Selected Candidate
Charlie

Here, the randomly selected candidate is Charlie, as the generated number is 3.

Why Use RANDBETWEEN?

The RANDBETWEEN function is particularly useful when you need to introduce randomness into your data analysis or simulations. It allows you to easily generate random numbers without the need for complex algorithms or manual input.

Key Takeaways:

  • RANDBETWEEN: Generates random integers between two specified numbers.
  • Useful for Randomization: Helps in simulations, random sampling, and creating test data.
  • Common Use Cases: Ideal for surveys, experiments, and any scenario where randomness is required.

Understanding how to use the RANDBETWEEN function can significantly enhance your data manipulation capabilities in Excel, enabling you to incorporate randomness into your datasets effectively.

Happy randomizing!

Example use case

You have a project management spreadsheet where you need to assign random task completion deadlines to various team members. By using the RANDBETWEEN function, you can generate random dates within a specified range (e.g., between today and 30 days from now) for each task. This allows for simulating different scenarios for project timelines, helping the team to prepare for potential scheduling challenges and resource allocation without the need for manual date entry.

Beyond the RANDBETWEEN function: Better Analyst is a full Excel AI that goes well past individual formulas. Upload any spreadsheet and ask questions in plain English — you'll get formulas, data analysis, and charts back in seconds. It's a free AI Excel assistant that works with any .xlsx, .xls, or .csv file — no plugins, no Microsoft 365 required.

Don't have a spreadsheet yet? Use our free AI spreadsheet generator to turn a text prompt into a downloadable Excel file — a full AI Excel sheet maker that builds headers, columns, and formulas from your description.

Need more help with Excel formulas?

Create a free account for formula help, explanations, and spreadsheet analysis. Usage limits depend on your plan.

Explore all Excel formulas

Browse our complete library of Excel formula guides

Compare your options

Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

  1. 01ChatGPTOpen a balanced comparison prompt in ChatGPT.
  2. 02ClaudeOpen the same research prompt in Claude.
  3. 03PerplexityResearch the comparison with linked web sources.

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.