RANDBETWEEN(low, high)One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.
low:
The lower bound of the random number range. This is the smallest integer that can be returned by the function.
high:
The upper bound of the random number range. This is the largest integer that can be returned by the function.
The RANDBETWEEN function in Google Sheets is a simple yet effective tool used to generate random integers between two specified values. This function is particularly useful for scenarios where you need to create random data, such as simulations, games, or testing purposes.
In simpler terms, RANDBETWEEN allows you to easily generate random numbers within a defined range, making it a handy function for various applications.
Imagine you are conducting a survey and want to randomly assign participants to different groups. You need to generate random group numbers for each participant.
| ParticipantID | GroupNumber |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |
You want to assign each participant a random group number between 1 and 3.
To achieve this, you would use the RANDBETWEEN function as follows:
=RANDBETWEEN(1, 3)In this formula:
1 is the minimum value (the lowest group number).3 is the maximum value (the highest group number).When you apply the RANDBETWEEN formula to the GroupNumber column for each participant, the output might look like this:
| ParticipantID | GroupNumber |
|---|---|
| 1 | 2 |
| 2 | 1 |
| 3 | 3 |
| 4 | 2 |
| 5 | 1 |
Each time you refresh the sheet or make any changes, the group numbers will change randomly, providing a new assignment for each participant.
RANDBETWEEN is beneficial because it simplifies the process of generating random numbers in Google Sheets. It eliminates the need for complex formulas or manual entry, allowing you to quickly create random data for testing or simulations. Additionally, it can be used in combination with other functions to enhance data analysis and modeling.
RANDBETWEEN is an essential function for anyone looking to incorporate randomness into their spreadsheets, making it a valuable tool for data analysis and experimentation.
Happy spreadsheeting!
You have a list of products in Column A and want to randomly select a discount percentage for each product in Column B. Using the RANDBETWEEN formula, you can generate a random discount between 5% and 30%, allowing for dynamic pricing strategies.
Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.
Browse our complete library of Google Sheets 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.