MAP Function

Runs a LAMBDA on every value in an array and returns all the results.

Category

Logical

Available in

Microsoft 365, Excel 2024

Returns

A spilled array, one result per value

Taught hands-on in Level 5: Expert Techniques & Workbook Architecture - Modern Functions module

Overview

MAP goes through an array one value at a time, runs your LAMBDA on it, and spills back a result for each.

Its real strength is doing row-by-row logic that functions like AND and OR can't, because they collapse a whole range into one answer.

Syntax

=MAP(array1, [array2, …], lambda)

Arguments

ArgumentRequired?What it does
array1YesThe values to work through.
array2, …OptionalMore arrays of the same size, handed to the LAMBDA side by side.
lambdaYesA LAMBDA with one parameter per array. Always the last argument.

Examples

Example 1 — AND for every row

Qualify each rep with sales of 500+ and a rating of 4+, in one spilled formula.

D2fx=MAP(B2:B5, C2:C5, LAMBDA(s, r, IF(AND(s>=500, r>=4), "Yes", "No")))
ABCD
1RepSalesRatingBonus
2Ana6204.5Yes
3Ben4804.8No
4Cara5003.9No
5Dev7104.2Yes
=MAP(B2:B5, C2:C5, LAMBDA(s, r, IF(AND(s>=500, r>=4), "Yes", "No"))) Explain
  1. MAP hands each pair of values — Sales as s, Rating as r — to the LAMBDA.
  2. Because AND sees one pair at a time, it gives a separate answer for each row.

Example 2 — Cleaning every value

Tidy a column of names in one go.

=MAP(A2:A50, LAMBDA(n, PROPER(TRIM(n)))) Explain

Common mistakes

  • Arrays of different sizes. Every array must have the same shape, or MAP returns #VALUE!.

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.