Generating an Array of Random Numbers with RANDARRAY
August 25, 2022 - by Bill Jelen
![Generating an Array of Random Numbers with RANDARRAY Generating an Array of Random Numbers with RANDARRAY](/img/excel-tips/2022/08/generating-an-array-of-random-numbers-with-randarray.jpg)
The syntax for RANDARRAY
is =RANDARRAY([rows],[columns],[min],[max],[integer])
. Notice that all five arguments are optional.
=RANDARRAY(10)
generates 10 rows and 1 column of=RAND()
=RANDARRAY(,5)
generates one row and five columns of=RAND()
=RANDARRAY(2,3,1,9,True)
generates 2 rows and 3 columns of=RANDBETWEEN(1,9)
Traditionally, =RAND()
returns a decimal greater than or equal to 0 and less than 1. Originally, RANDARRAY
would only return RAND
. A change in February 2019 added the Min, Max, and Integer arguments to allow RANDARRAY
to simulate RANDBETWEEN
.
![=RANDARRAY(5,3) returns five rows and three columns of random decimals between 0 and 1.](/img/content/2022/08/STPA-49.png)
![The new version of RANDARRAY will return integers. =RANDARRAY(5,3,1,9,TRUE) returns 5 rows and 3 columns of random integers between 1 and 9.](/img/content/2022/08/randarray-does-randbetween.jpg)
This article is an excerpt from Power Excel With MrExcel
Title photo by Markus Krisetya on Unsplash