Skip to main content
SheetCraft
🧮 LAMBDA Helpers Function · advanced

MAP Function in Google Sheets

Applies a LAMBDA to every element of one or more arrays and returns an array of results. The modern, explicit alternative to ARRAYFORMULA for per-element transforms.

Syntax

MAP(array1, [array2, ...], lambda)

Returns: A new array of the same shape with the lambda applied to each element.

Excel equivalent: MAP (identical, requires Excel 2021+ or Microsoft 365)

Introduced: 2022

Parameters

NameRequiredDescription
array1, array2, ...RequiredOne or more arrays of the same shape.
lambdaRequiredA LAMBDA that takes as many parameters as there are arrays, returning the result for each element.

Examples

Single-column transform

=MAP(A2:A100, LAMBDA(x, x * x))

Squares every value. Returns 99 results.

Two-array zip

=MAP(A2:A100, B2:B100, LAMBDA(price, qty, price * qty))

Multiplies aligned rows from two columns. Same shape required.

Conditional categorization

=MAP(A2:A100, LAMBDA(x, IF(x > 100, "high", IF(x > 50, "medium", "low"))))

Buckets each value. Lambda body can use any normal formula.

When to use an alternative

  • ARRAYFORMULAYour operation is simple and you don't need explicit per-element logic.
  • BYROW / BYCOLYour function operates on whole rows or columns, not single cells.
  • REDUCEYou want to collapse to a single value, not return an array.

Common errors and how to fix them

  • Arrays must be the same dimensions

    Cause: Passed multiple arrays of different shapes.

    Fix: Trim to matching ranges. Use ARRAYFORMULA(RESIZE...) only as a last resort — usually a data-cleanup issue.

  • Wrong arity in lambda

    Cause: Passed two arrays but lambda only declares one parameter.

    Fix: Match parameter count to array count.

Related functions

Frequently Asked Questions

MAP vs ARRAYFORMULA — which should I use?

Both work. MAP is more explicit — you see exactly what runs per element and pass it via LAMBDA. ARRAYFORMULA relies on implicit broadcasting which can be surprising with some functions. For new formulas, MAP is generally cleaner. For maximum compatibility with older sheets, ARRAYFORMULA.

Does MAP work across columns and rows together?

MAP iterates element-by-element. Pass a 2D range and it'll apply the lambda to every cell. For row-by-row or column-by-column operations use BYROW or BYCOL instead.

Source: Google Sheets official function reference.