RANDBETWEEN Function in Google Sheets: Formula, Examples & Troubleshooting
Use RANDBETWEEN in Google Sheets for inclusive random integers. Understand decimal bounds, repeated draws, cent-sized scenarios, and static results.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =RANDBETWEEN(1,6) returns one integer from 1 through 6, including both endpoints. Every eligible integer has the same probability; a specific roll cannot be predicted.
Verification: NOT_TESTED_IN_GOOGLE_SHEETS. Google sources were reviewed October 17, 2026. Sets, probabilities, and transformed examples below were independently calculated; illustrative random draws are not observed Sheets output.
Syntax and arguments
=RANDBETWEEN(low, high)
Both arguments are required. low and high define the inclusive interval from which an integer is drawn. Google allows decimal limits: the smallest possible result is the least integer at or above the lower bound, and the largest is the greatest integer at or below the upper bound. Google RANDBETWEEN reference.
For example, =RANDBETWEEN(2.2,5.8) has the possible results 3, 4, and 5. It does not return fractional values, and it does not round the limits to the nearest integers. The documentation does not specify exact error tokens for invalid intervals or nonnumeric inputs.
Example: a six-outcome training exercise
Create these cells:
| Cell | Content |
|---|---|
| A1 | Trial |
| B1 | Outcome |
| D1 | Lowest outcome |
| E1 | Highest outcome |
| D2 | 1 |
| E2 | 6 |
- Enter trial labels 1 through 5 in A2:A6.
- In B2, enter
=RANDBETWEEN($D$2,$E$2). - Fill B2 down through B6.
- Check that each outcome is an integer from 1 to 6. Do not expect a particular sequence.
An illustrative sequence might be 2, 6, 2, 1, 5. The repeated 2 is valid. Five calls do not promise five different values, and six calls do not promise one of every outcome.
There are six equally likely results for each draw, so a specified outcome has probability 1/6, approximately 16.67%. That is a long-run probability, not a quota that each small batch must satisfy. A classroom demonstration with a few rows cannot certify the quality of a random generator.
Decimal and negative bounds
These expected result sets follow directly from the documented integer-within-bounds rule:
| Formula | Eligible integers |
|---|---|
=RANDBETWEEN(3,5) |
3, 4, 5 |
=RANDBETWEEN(2.2,5.8) |
3, 4, 5 |
=RANDBETWEEN(-2.8,1.2) |
-2, -1, 0, 1 |
=RANDBETWEEN(7,7) |
7 |
The last interval contains exactly one possible integer. By contrast, the interval from 2.2 to 2.8 contains none. Fix such an input range instead of expecting the function to invent an out-of-range result. This guide does not claim a particular Sheets error message for that case.
Advanced use: values spaced one cent apart
Suppose a training model needs an amount between 18.00 and 22.00, with one-cent increments. Generate integer cents and then change the unit:
=RANDBETWEEN(1800,2200)/100
There are 2200 − 1800 + 1 = 401 eligible cent amounts. If the integer draw were 1937, the displayed amount would be 19.37. The two endpoint draws become 18.00 and 22.00. This construction gives equal probability to each eligible cent amount under the function’s documented uniform-integer model.
For amounts spaced by 0.25, use =RANDBETWEEN(72,88)/4. The output set contains 17 amounts from 18.00 through 22.00. This is a different model from drawing a continuous decimal and rounding it, which can assign different weights to endpoint buckets.
Keep a draw from changing
Google identifies RANDBETWEEN as a volatile function. A cell containing the formula is therefore unsuitable as a permanent identifier or a fixed audit record. To preserve a chosen sample, copy the generated results and use Edit → Paste special → Values only into another range in the same spreadsheet. Keep labels and the generation rule with the saved sample so its origin remains clear. Google volatility and static-value guidance.
Troubleshooting and limits
- A result repeats: Repetition is compatible with random draws. RANDBETWEEN is not a without-replacement sampler.
- A fractional limit was never returned: The output is always an eligible integer; decimal limits constrain the set rather than changing the output type.
- An input bound is reversed: Check the lower and upper inputs before generating. For decimal bounds, also check that at least one integer lies between them.
- An import reports a volatile-dependency error: Google explicitly documents this restriction for RANDBETWEEN. Use a static value when the import must refer to a stable input.
- You need reproducibility: There is no documented seed parameter in this signature. Saving the values preserves the sample; saving only the formula does not reproduce the same draw.
Availability and related guides
Google documents the function as available on the review date; its original release and any retirement or last-working version were not established. This page makes no claim of matching Excel’s random stream, errors, or recalculation behavior.
See SEQUENCE for deterministic trial labels, COUNTIF for counts in a saved sample, and ROUND when your model explicitly calls for rounding.
First-party references reviewed October 17, 2026: RANDBETWEEN, volatile dependencies, and paste special.