Maintenance Notification: We are upgrading our servers today so you may experience intermediate outages. Thank you for your patience.
Fill cells based on existing data
MO-211

Generate numeric data by using RANDARRAY()

=RANDARRAY(5,1,1,6,TRUE)

Five whole numbers from 1 to 6, spilled down from one cell. The arguments are rows, columns, the smallest and largest value, then TRUE for whole numbers.

What the MO-211 task asks

A RANDARRAY task in our MO-211 practice exams gives the size, the range and whole numbers: “In G4, generate 20 random blind-control IDs in one spill: 20 rows, 1 column, whole numbers between 10000 and 99999. Enter one formula; the values below spill on their own.”

The numbers change every time Excel recalculates, so no grader can check them one by one. Ours checks the shape and the bounds instead: a dynamic-array formula in the cell, a spill of exactly 20 rows and 1 column, and every value a whole number from 10000 to 99999.

That makes each argument count. Leave out TRUE and you get decimals; swap the size round and the spill is the wrong shape. Both score nothing even though the cells fill.

Worked examples

Type these into a blank sheet to follow along. Every result below is what Excel showed.

Draw: what =RANDARRAY(5,1,1,6,TRUE) in A2 fills (the numbers themselves change on every recalculation)
A
1Roll
21–6
31–6
41–6
51–6
61–6
Only a size
=RANDARRAY(5)
Returns five decimals between 0 and 1, spilled into A2:A6

With no other arguments, RANDARRAY returns decimals from 0 up to 1, in one column.

Rows, columns and whole numbers
=RANDARRAY(3,2,1,6,TRUE)
Returns six whole numbers from 1 to 6, in 3 rows and 2 columns

Both ends are included: across 1,000 draws we saw every number from 1 to 6, and nothing else.

A range of decimals
=RANDARRAY(4,1,10,20)
Returns four decimals between 10 and 20

Without TRUE, the values are decimals anywhere in the range.

Six-digit references across a row
=RANDARRAY(1,3,100000,999999,TRUE)
Returns three whole numbers of six digits, side by side

One row and three columns spills to the right instead of down.

The smallest bigger than the largest
=RANDARRAY(2,2,6,1,TRUE)
Returns #VALUE!

The minimum comes before the maximum. Swap them round.

In the video
=RANDARRAY(5,1,1,6,TRUE)
Returns five whole numbers from 1 to 6 in A2:A6, new ones after F9

The quick answer above, typed in A2. F9 recalculates and every number changes, while the shape and the range stay the same.

Watch it done in Excel

The last example above, recorded in real Excel on the same grid.

Exam traps

Leaving out TRUE

=RANDARRAY(2,2,1,6) returns decimals such as 2.11746. A task that says whole numbers needs TRUE as the fifth argument.

Whole numbers between decimal bounds

=RANDARRAY(3,1,1.5,3.5,TRUE) returns #VALUE!. With TRUE, give whole-number bounds.

Something in the way

A spill needs empty cells. If anything sits in the cells the result would fill, the formula shows #SPILL! until you clear them.

Pasting the values to stop them changing

Copy and Paste Values does freeze the numbers, but the cell then holds a number, not a formula. A task that asks for one formula wants the formula left in place.

FAQ

Why do the numbers keep changing?

RANDARRAY draws new numbers every time the sheet recalculates: press F9, or type into any other cell, and they change. The shape and the range stay as you set them.

Can RANDARRAY repeat a number?

Yes. Each value is drawn on its own, so whole numbers from a small range repeat often: 1,000 draws from 1 to 6 used only those six numbers.

How is it different from RANDBETWEEN?

RANDBETWEEN, on MO-210, gives one whole number in one cell. RANDARRAY spills a whole block from one formula, and gives decimals unless you ask for whole numbers.

What if I leave out the columns?

Each missing argument takes its default: =RANDARRAY(3,,1,6,TRUE) spills 3 rows in 1 column.

New to this function?

This page covers what the exam asks. For the full how-to — every argument, more examples and a practice workbook — read our guide on dfwexcel.com.

The RANDARRAY function, explained — dfwexcel.com

Try it under exam conditions

Take a full, timed MO-211 practice exam, upload the workbook you built, and get a score out of 1000 with a per-task breakdown of where the points went. Your first one is free.

No credit card needed.