# RANDBETWEEN in Google Sheets: syntax and examples

URL: https://goingstellar.ro/reference/sheets/randbetween/

RANDBETWEEN returns a random whole number between low and high. It is volatile: the value changes every time the sheet recalculates. Pair it with INDEX to pick a random item from a list.

## Syntax

```
RANDBETWEEN(low, high)
```

## Arguments

- `low` (number, required: yes): The smallest value that can come out.
- `high` (number, required: yes): The largest value that can come out. Included.

## Examples

The examples use this table, starting in A1:

| Name |
|---|
| Ana |
| Bob |
| Cris |
| Dan |
| Eva |

```
=LET(r, RANDBETWEEN(1, 6), AND(r >= 1, r <= 6))
```

Result: `TRUE`

A dice roll: the value is always between 1 and 6. LET keeps one draw so both tests see the same number. Run in a Google Sheet (English US locale) on 2026-11-29. The result changes over time; this is the value on the run date.

```
=RANDBETWEEN(5, 5)
```

Result: `5`

When low and high are equal, the only possible result is that value. Run in a Google Sheet (English US locale) on 2026-11-29. The result changes over time; this is the value on the run date.

```
=LET(r, RANDBETWEEN(-3, 3), AND(r >= -3, r <= 3))
```

Result: `TRUE`

Negative bounds work too. Run in a Google Sheet (English US locale) on 2026-11-29. The result changes over time; this is the value on the run date.

```
=COUNTIF(A2:A6, INDEX(A2:A6, RANDBETWEEN(1, 5))) = 1
```

Result: `TRUE`

Pick a random name: RANDBETWEEN chooses the position, INDEX returns the name. The test confirms the pick is in the list. Run in a Google Sheet (English US locale) on 2026-11-29. The result changes over time; this is the value on the run date.

```
=LET(r, RANDBETWEEN(1, 100), r = INT(r))
```

Result: `TRUE`

The result is always a whole number. Run in a Google Sheet (English US locale) on 2026-11-29. The result changes over time; this is the value on the run date.

## Common errors

- low and high are both allowed values. When they are equal, the result is that value: RANDBETWEEN(5, 5) returns 5.
- low greater than high returns #NUM!. Decimal bounds do not cause an error: RANDBETWEEN(2.5, 2.9) returns 3.
- The value changes whenever the sheet recalculates. To keep a draw, copy the cell and use Paste special → Values only.
- Every RANDBETWEEN call draws its own number. Store one draw with LET when the formula needs the same number twice, as in the first example.

## Compared with Excel

Same syntax as Excel RANDBETWEEN.

## Related functions

- [RAND](https://goingstellar.ro/reference/sheets/rand/)
- [INDEX](https://goingstellar.ro/reference/sheets/index/)
- [SEQUENCE](https://goingstellar.ro/reference/sheets/sequence/)
- [SORT](https://goingstellar.ro/reference/sheets/sort/)

## Sources

- [RANDBETWEEN (Docs Editors Help)](https://support.google.com/docs/answer/3093507)

