# Excel RANDARRAY function

## Summary

The Excel RANDARRAY function generates an array of random numbers within a specified range. You can define the array’s size using the rows and columns arguments, and specify the range with minimum and maximum values. This function is ideal for simulations, random sampling, or any situation requiring an array of random numbers.
##### Syntax
```				```
=RANDARRAY([rows], [columns], [min], [max], [integer])
```
```
• [rows]: [Optional] The number of rows in the array. Defaults to 1
• [columns]: [Optional] The number of columns in the array. Defaults to 1
• [min]: [Optional] The minimum value of the random numbers. Defaults to 0
• [max]: [Optional] The maximum value of the random numbers. Defaults to 1
• [integer]: [Optional] Whether to generate whole numbers (TRUE) or decimal numbers (FALSE). Defaults to FALSE
##### Return value
An array of random values between the specified minimum and maximum values.

## How to use

RANDARRAY can generate both decimal and whole numbers. By default, it produces decimal numbers between 0 and 1. Adjust the rows, columns, min, max, and integer arguments to customize the output.

## Examples

##### Simple RANDARRAY
Generating a Basic Random Array: Creating a simple array of random numbers:
```				```
=RANDARRAY(3, 3)
```
```
Generates a 3×3 array of random decimal numbers between 0 and 1.
##### RANDARRAY for Random Sampling
Random Sampling in Data Analysis: Creating a random sample for analysis:
```				```
=RANDARRAY(10, 1, 1, 100, TRUE)
```
```
Generates an array of 10 random whole numbers between 1 and 100.
##### RANDARRAY for Simulation
Creating Random Data for Simulations: Simulating random data points:
```				```
=RANDARRAY(5, 2, 0, 50)
```
```
Generates a 5×2 array of random decimal numbers between 0 and 50.
##### RANDARRAY for Date Generation
Random Date Generation within a Year: Creating random dates within a specific range:
```				```
=RANDARRAY(5, 1, TODAY(), EDATE(TODAY(), 12), TRUE)
```
```
Generates an array of 5 random dates within the next year.
##### RANDARRAY with CHAR for Random Text
Generating Random Letters: Creating random letters:
```				```
=CHAR(RANDARRAY(1, 10, 65, 90, TRUE))
```
```
Generates an array of 10 random uppercase letters (A-Z).