# RANDARRAY

array · from excel · excel: verified match · sheets: verified match

returns an array of random numbers

## signature

```
RANDARRAY([rows], [columns], [min], [max], [whole_number])
```

returns: `array` · volatile: recomputes on every evaluation

## arguments

- rows: number: optional
- columns: number: optional
- min: number: optional
- max: number: optional
- whole_number: boolean: optional

## examples

formula and result, asserted in the engine test suite.

| formula | result | with |
| --- | --- | --- |
| `=RANDARRAY(1,1,10,5)` | `#VALUE!` | none |
| `=RANDARRAY(1,1,2,)` | `#VALUE!` | none |
| `=RANDARRAY(1048577, 1)` | `#VALUE!` | none |
| `=RANDARRAY(1,16385)` | `#VALUE!` | none |
| `=RANDARRAY(1000,1001)` | `#ERROR!` | none |
| `=RANDARRAY(0)` | `#CALC!` | none |

## errors

error values observed from the engine: each with a call that produces it.

| error | produced by |
| --- | --- |
| `#VALUE!` | `=RANDARRAY(1,-1)` |
| `#ERROR!` | `=RANDARRAY(1000,1001)` |
| `#CALC!` | `=RANDARRAY(1,0)` |

## related

- [ARRAY_CONSTRAIN](https://deepcalc.com/docs/functions/array-constrain.md): truncates a range to at most the given rows and columns
- [ARRAYFORMULA](https://deepcalc.com/docs/functions/arrayformula.md): evaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility)
- [ARRAYTOTEXT](https://deepcalc.com/docs/functions/arraytotext.md): converts array to text representation
- [BYCOL](https://deepcalc.com/docs/functions/bycol.md): applies lambda to each column of array
- [BYROW](https://deepcalc.com/docs/functions/byrow.md): applies lambda to each row of array
- [CHOOSECOLS](https://deepcalc.com/docs/functions/choosecols.md): returns the specified columns from an array
- [CHOOSEROWS](https://deepcalc.com/docs/functions/chooserows.md): returns the specified rows from an array
- [DROP](https://deepcalc.com/docs/functions/drop.md): removes rows or columns from the start or end of an array

## navigate

- [all array functions](https://deepcalc.com/docs/functions/array-functions.md)
- [function index](https://deepcalc.com/docs/functions.md): all 602 functions
- [error values](https://deepcalc.com/docs/errors.md) · [concepts](https://deepcalc.com/docs/concepts.md) · [limits](https://deepcalc.com/docs/limits.md)
- [everything in one file](https://deepcalc.com/llms-full.txt)

source: https://deepcalc.com/docs/functions/randarray