MAKEARRAY Function in Google Sheets: Syntax, Examples & Troubleshooting
Generate a calculated grid from row and column indices, including ordered labels, pairwise differences and a triangular layout.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: MAKEARRAY constructs a new rectangular array by calculating each cell from its one-based row and column indices. It is useful when the formula defines the grid, rather than transforming an existing block of cells.
Availability and version history
- Introduced: Announced August 24, 2022; the extended rollout was expected to finish by September 26, 2022. Google release history.
- Availability: Documented in the rolling Google Sheets service. This guide covers ordinary worksheet formulas in the web workflow; it does not establish separate mobile or connected-database behavior.
- Checked: October 14, 2026, against the official MAKEARRAY reference. Documentation and independent calculations; no native application execution.
Syntax and the two indices
=MAKEARRAY(rows,columns,LAMBDA(row_index,column_index,expression))
Supply the desired dimensions and a LAMBDA with exactly two names. The first name receives the output row index; the second receives the output column index. Both start at one within the generated array, regardless of where the formula is entered.
Every call must return one value. A named function with two corresponding placeholders can replace the inline LAMBDA; pass its name without parentheses. All examples below use positive integer dimensions and deterministic expressions, so no setup or random seed is required.
Example 1: make the coordinates visible
In an empty area, enter:
=MAKEARRAY(3,4,LAMBDA(row_index,column_index,100*row_index+column_index))
The exact three-row by four-column result is:
| 101 | 102 | 103 | 104 |
| 201 | 202 | 203 | 204 |
| 301 | 302 | 303 | 304 |
The unlabeled table is the complete output, with no generated header. If the formula starts at F10, the first value is still 101, not 1006 or 1010. These indices belong to the result grid, not to worksheet coordinates.
The hundreds portion identifies the generated row for this four-column demonstration. This encoding is not intended as a collision-free identifier scheme for arbitrarily large dimensions.
Example 2: number cells in reading order
=MAKEARRAY(3,4,LAMBDA(row_index,column_index,(row_index-1)*4+column_index))
The result is 1,2,3,4 / 5,6,7,8 / 9,10,11,12. Subtracting one removes the row offset before multiplying by the width. If the requested width changes from four to five, the multiplication factor must change too.
For ordinary consecutive numbers, SEQUENCE is simpler. This explicit calculation is helpful when a more specialized grid uses the same row-offset idea.
Advanced example: all pairwise absolute differences
Enter A2=10, A3=15, and A4=23, then place this formula outside A2:A4:
=MAKEARRAY(3,3,LAMBDA(row_index,column_index,ABS(INDEX(A2:A4,row_index)-INDEX(A2:A4,column_index))))
The complete result is:
| 0 | 5 | 13 |
| 5 | 0 | 8 |
| 13 | 8 | 0 |
The diagonal compares each value with itself. The off-diagonal values are mirrored because absolute difference ignores direction. For a signed difference matrix, remove ABS; then the upper-right value becomes −13 and the lower-left becomes 13.
This example compares observations in the same units. It does not normalize differences or determine whether a difference is acceptable. The INDEX guide explains retrieving source values by relative position.
Example 3: create a triangular display
=MAKEARRAY(3,3,LAMBDA(row_index,column_index,IF(column_index>=row_index,column_index-row_index+1,"")))
The expected rows are 1,2,3 / empty text,1,2 / empty text,empty text,1. The lower-left cells contain formula-returned empty strings, not unused worksheet cells. That distinction can matter to later blank tests or exports.
The condition selects which positions receive visible values; MAKEARRAY still creates the full three-by-three array. It does not create a jagged object with shorter rows.
Errors, dimensions and verification
Google documents #N/A for an incorrect number of LAMBDA names and rejects nested-array results. A name that looks like a cell reference is invalid. Keep both index names even when the expression uses only one of them.
Start with a small positive-integer grid and reserve its entire output area. This guide does not assign native error codes to every invalid dimension or storage-limit case; those require separate target-file checks. The supplied arrays and differences were independently calculated, without native Sheets execution.
Use an English-locale comma separator for these examples. To compare with another program, check the whole grid and helper naming rules, not just the top-left cell. LAMBDA and IF provide the underlying building blocks.