Wauvel

Excel like a finance pro.

← The library

Dynamic array function

RANDARRAY

Returns an array of random numbers of the size you specify.

OccasionalDifficulty 1400 · AdvancedUsage rank #129 of 520
Practice · 3 questions →

When to use it

An array of random numbers of any size: decimals by default, integers between bounds with the last argument TRUE. Recalculates constantly.

The shape of it

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

Worked examples

  • Random decimals

    =RANDARRAY(3) {0.42;0.87;0.13}

    Three random decimals down a column.

  • Random integers

    =RANDARRAY(5,1,1,100,TRUE) {17;83;4;56;91}

    Five whole numbers from 1 to 100.

  • Shuffle a list

    =SORTBY(A2:A11,RANDARRAY(10)) shuffled list

    A random order of ten names, with no repeats.

Worth knowing

  • Freeze with Copy, Paste Special, Values.
  • Random sample of n rows: =TAKE(SORTBY(data,RANDARRAY(ROWS(data))),n).
  • Random dates: RANDARRAY(n,1,start_date,end_date,TRUE).

Where it goes wrong

  • #SPILL! when the output area is blocked.
  • Every recalculation changes the values.

Related

Learn the moves here — or let Wauvel run them on your numbers.

Meet your AI CFO →

One CFO-grade Excel tip a week

A short, practical email for finance operators — functions, shortcuts, and the moves that save an afternoon. Free, unsubscribe anytime.