MAKEARRAY Function

Builds a grid of any size, filling each cell with a LAMBDA based on its row and column.

Category

Logical

Available in

Microsoft 365, Excel 2024

Returns

A spilled array of the size you ask for

Want to practice MAKEARRAY in a real spreadsheet? Open a blank sheet in our Practice Sandbox and try it with live data, with the AI Excel tutor beside you. No Excel needed — just a free account.Try it free in the Sandbox

Overview

MAKEARRAY creates an array from scratch. You say how many rows and columns, and your LAMBDA decides what goes in each position.

The LAMBDA receives the row number and column number, so the content can depend on where it sits — ideal for tables, labels and test data.

Syntax

=MAKEARRAY(rows, cols, lambda(row, col)) Explain

Arguments

ArgumentRequired?What it does
rowsYesHow many rows to create.
colsYesHow many columns to create.
lambdaYesA LAMBDA with two parameters, row and column, returning the value for that position.

Examples

Example 1 — A multiplication grid

Three rows by four columns, each cell row × column.

A1fx=MAKEARRAY(3, 4, LAMBDA(r, c, r*c))
ABCD
11234
22468
336912
=MAKEARRAY(3, 4, LAMBDA(r, c, r*c)) Explain

Example 2 — Seat labels

Rows A–C, seats 1–5.

=MAKEARRAY(3, 5, LAMBDA(r, c, CHAR(64+r) & c)) Explain

Spills A1 to A5 on the first row, B1 to B5 on the second and C1 to C5 on the third. CHAR(65) is the letter A.

Example 3 — Practice data

Fill 10 rows × 3 columns with random whole numbers.

=MAKEARRAY(10, 3, LAMBDA(r, c, RANDBETWEEN(1, 100))) Explain
Random values recalculate constantly. Copy and Paste Values once you're happy with them.

Common mistakes

  • #VALUE! errors. rows or cols is zero, negative or not a number.
  • #SPILL! errors. Cells in the way of the result. Clear the area.

Notes

Kyle Stott

Author

Kyle Stott

Certified Microsoft Excel Expert

Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.