[]
This function returns an array of random numeric values. Users can specify the number of rows and columns, and minimum and maximum values, and indicate whether to return integers or decimal values.
RANDARRAY([rows],[columns],[min],[max],[integer])
RANDARRAY function has the following arguments:
Argument | Description |
---|---|
rows | Specifies the number of rows of random numbers to generate (if nothing is specified, the default value 1 is used). |
columns | Specifies the number of columns of random numbers to generate (if nothing is specified, the default value 1 is used). |
min | Specifies the minimum of values to generate (if nothing is specified, the default value 0 is used). |
max | Specifies the maximum of values to generate (if nothing is specified, the default value 1 is used). |
integer | Returns an integer only if the specified value is Boolean TRUE. If this value is FALSE, this function returns a decimal value (if nothing is specified, the default value FALSE is used). |
Accepts the number of rows and columns. Returns an array of random numbers.
Note: RANDARRAY is a volatile function. This means that each time the worksheet calculates, the RANDARRAY function recalculates the new values.
By default, if users don't specify the row or column argument, the RANDARRAY function will return a single value between 0 and 1. Also, if minimum and maximum arguments are not specified, then the RANDARRAY function returns a random set of values between 0 and 1. The minimum number argument should always contain a value that is less than the maximum number, else this function will return a #VALUE! error. Further, if the whole-number argument is empty, then this function will choose FALSE as the default value and the decimal value will be returned.
For instance - Cell A8 in the following image contains the formula "=RANDARRAY(5,3)" and returns a random set of values between 0 and 1.
RANDARRAY(5,3,1,100)
returns a series of random decimal values between 1 and 100.
RANDARRAY(5,3,1,100,TRUE)
returns a series of random whole numbers between 1 and 100.
This function is available in SpreadJS 13 or later.