# RANDBETWEEN Function

> Return a random integer between two numbers with the RANDBETWEEN formula function of TX Sheet Control: rounding of bottom and top and the #NUM! error.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Function
- **Path:** TX Sheet Control > API Reference > Formula Functions > RANDBETWEEN Function
- **201 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/randbetween/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/randbetween/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/randbetween/llms-full.txt

---

Return a random integer between two numbers, both included. `bottom` is the smallest and `top` the largest integer that can be returned; `bottom` is rounded up and `top` down to an integer. A `bottom` greater than `top` after rounding returns `#NUM!`. Every call returns a new number.

### Syntax

```text
RANDBETWEEN(bottom, top)
```

Category: Math. Minimum arguments: 2. Maximum arguments: 2.

Available for supported offline calculation.

### Examples

```text
=RANDBETWEEN(1,10)
```

The formula returns an integer from 1 to 10.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

### See Also

- [Formulas](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/formulas/llms-full.txt)
- [Custom Functions and Formula Data](https://docs.textcontrol.com/tx-sheet-control/spreadsheets/custom-functions/llms-full.txt)

---

## Nearby

- **Previous:** [RANDARRAY Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/randarray/llms-full.txt)
- **Next:** [RANK Function](https://docs.textcontrol.com/tx-sheet-control/reference/formula-functions/rank/llms-full.txt)
