=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.
bottom:
The smallest integer that RANDBETWEEN can return.
top:
The largest integer that RANDBETWEEN can return.
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.
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 ID | Name |
|---|---|
| 1 | Alice |
| 2 | Bob |
| 3 | Charlie |
| 4 | David |
| 5 | Eve |
You want to randomly select a candidate from this list.
To randomly select a candidate, you would use the RANDBETWEEN formula as follows:
=RANDBETWEEN(1, 5)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.
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.
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!
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.
Create a free account for formula help, explanations, and spreadsheet analysis. Usage limits depend on your plan.
Browse our complete library of Excel formula guides
Compare your options
Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.
AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.