Logic & Modern Lambdas FormulaGoogle Sheets V8 Engine Verified

Google Sheets MAP: Transform Arrays Row-by-Row with LAMBDA

MAP applies a custom LAMBDA function to every element in one or more arrays, producing an array of transformed results. Unlike ARRAYFORMULA, MAP works with functions like AND, OR, and complex custom logic.

Formula Syntax:=MAP(array1, [array2, ...], LAMBDA(val1, [val2, ...], expression))

Formula Parameters & Arguments

ArgumentTypeRequiredDescription
array1RangeRequiredThe input range to map over.
LAMBDAFunctionRequiredLambda expression that processes each element.

Real-World Spreadsheet Examples

Explore verified operational formulas used in enterprise reporting and database workflows:

Example 1: Evaluate Compound AND Condition Row-by-Row

=MAP(A2:A100, B2:B100, LAMBDA(status, spend, AND(status="Active", spend > 5000)))
How it works: Solves the classic limitation where `AND()` does not work inside standard ARRAYFORMULA.

Example 2: Classify Customer Score Tiers

=MAP(A2:A100, LAMBDA(score, IFS(score >= 90, "Tier 1", score >= 70, "Tier 2", TRUE, "Standard")))
How it works: Applies multi-tier customer categorization down an entire column.

Example 3: Calculate Distance / Coordinates Across Two Columns

=MAP(A2:A50, B2:B50, LAMBDA(lat, lon, SQRT(lat^2 + lon^2)))
How it works: Computes multi-column mathematical equations cleanly.

Common Errors & Solutions

❌ #VALUE! Arrays must have identical dimensions
Resolution: All input ranges passed into MAP must have the exact same row count.

Performance Pro Tips

  • Use MAP whenever you need row-level logic involving AND(), OR(), or external lambda transformations.

Frequently Asked Questions

Does MAP recalculate automatically when data changes?

Yes. Google Sheets recalculates all dependent formulas immediately whenever referenced input cells are modified.

Is this formula compatible with Microsoft Excel?

Modern functions like XLOOKUP, FILTER, UNIQUE, SORT, and LET are natively supported in Excel 365. However, QUERY is unique to Google Sheets and uses the Google Visualization API syntax.

Related Google Sheets Formulas