RANDARRAY

returns an array of random numbers · from excel · excel: verified match · sheets: verified match

signature

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

returns: array · volatile — recomputes on every evaluation

argumentrequired
rows optional
columns optional
min optional
max optional
whole_number optional

examples

formula and result, taken from the engine's own test suite — every result below is asserted in CI, not written by hand.

fx =RANDARRAY(1,1,10,5) #VALUE!
fx =RANDARRAY(1,1,2,) #VALUE!
fx =RANDARRAY(1048577, 1) #VALUE!
fx =RANDARRAY(1,16385) #VALUE!
fx =RANDARRAY(1000,1001) #ERROR!
fx =RANDARRAY(0) #CALC!

errors

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

errorproduced by
#VALUE! =RANDARRAY(1,-1)
#ERROR! =RANDARRAY(1000,1001)
#CALC! =RANDARRAY(1,0)

related

  • ARRAY_CONSTRAIN truncates a range to at most the given rows and columns
  • ARRAYFORMULA evaluates an expression across a range (this engine already spills, so it is a pass-through for sheets compatibility)
  • ARRAYTOTEXT converts array to text representation
  • BYCOL applies lambda to each column of array
  • BYROW applies lambda to each row of array
  • CHOOSECOLS returns the specified columns from an array