Array

MAKEARRAY Formula

Creates a calculated array of specified dimensions using a LAMBDA function that receives each cell's row and column index. MAKEARRAY is a power tool for generating structured grids — multiplication tables, distance matrices, conditional patterns — where each cell's value depends on its position.

Syntax

MAKEARRAY(rows, cols, lambda)
ParameterDescription
rows Parameter of the MAKEARRAY function.
cols Parameter of the MAKEARRAY function.
lambda Parameter of the MAKEARRAY function.
Try MAKEARRAY in Viztab — free, no signup

Examples

Multiplication table

Formula
=MAKEARRAY(10, 10, LAMBDA(r, c, r*c))
Creates a 10x10 multiplication table where each cell is the product of its row and column number.

Identity matrix

Formula
=MAKEARRAY(5, 5, LAMBDA(r, c, IF(r=c, 1, 0)))
Creates a 5x5 identity matrix with 1s on the diagonal and 0s elsewhere. Useful for linear algebra calculations.

Checkerboard pattern

Formula
=MAKEARRAY(8, 8, LAMBDA(r, c, IF(MOD(r+c, 2)=0, "B", "W")))
Creates an 8x8 checkerboard grid alternating between 'B' (black) and 'W' (white) based on position parity.

Common Errors

#VALUE!

The LAMBDA function doesn't accept exactly 2 parameters (row and column index), or rows/cols is not a positive integer.

#CALC!

The LAMBDA function returns an error for one or more row/column combinations.

Tips

Row and column are 1-based

The LAMBDA receives row and column indices starting from 1, not 0. The top-left cell gets r=1, c=1.

Generate test data

Use MAKEARRAY to create structured test data: =MAKEARRAY(100, 5, LAMBDA(r,c, r*100+c)) generates unique IDs for a 100x5 grid.

Any formula inside the LAMBDA

The LAMBDA body can use IF, MOD, math, text functions — anything. The row and column arguments let you create position-dependent patterns.

Try MAKEARRAY in Viztab

Import your data and use MAKEARRAY with 370+ other formulas. No signup required.

Open Viztab

Related Formulas