Exceljet

Quick, clean, and to the point

Excel RANDARRAY Function

Excel RANDARRAY function
Summary 

The Excel RANDARRAY function generates an array of random numbers between. The size or the array is is specified by rows and columns arguments. Generated values can be either decimals or whole numbers.

Purpose 
Get array of random numbers
Return value 
Array of random values
Syntax 
=RANDARRAY ([rows], [columns], [min], [max], [integer])
Arguments 
  • rows - [optional] Number of rows to return. Default = 1.
  • columns - [optional] Number of columns to return. Default = 1.
  • min - [optional] Minimum value to return. Default = 0.
  • max - [optional] Maximum value to return. Default = 1.
  • integer - [optional] Return whole numbers. Boolean, TRUE or FALSE. Default = FALSE.
Usage notes 

The RANDARRAY function is a "Dynamic array function". RANDARRAY returns an array of random numbers between 0 and 1. The size or the array is determined by supplied rows and columns arguments. The values generated by RANDARRAY can be either decimal values or whole numbers. When RANDARRAY returns multiple results in a worksheet, results will spill into adjacent cells.

Example #1

In the example shown, RANDARRAY is used to generate 50 values in a range10 rows by 5 columns. The formula in B4 is:

=RANDARRAY(10,5)

Example #2

To return a random array of integers, 5 rows by 2 columns,  between 1 and 10, you can use a formula like this:

=RANDARRAY(5,2,1,10,TRUE)
RANDARRAY is a new function available in Office 365 only.
Excel foundational video course
Excel Pivot Table video training course
Excel formulas and functions video training course
Excel Shortcuts Video Course
Excel Charts video training course
Video training for Excel Tables