# MAP function in Excel

> MAP runs a LAMBDA on each value of an array, or on matching values from several arrays, and returns an array of the same size.

Source: https://spreadsheetpractice.com/functions/map · Updated October 28, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on October 30, 2026

## Quick answer

- **What it does:** MAP runs a LAMBDA on each value of an array, or on matching values from several arrays, and returns an array of the same size.
- **Syntax:** `=MAP(array1, [array2], ..., lambda)`
- **Most common use:** `=MAP(B2:B4,C2:C4,LAMBDA(s,t,IF(AND(s>=t,s>10000),"Bonus","-")))` returns Bonus (AND checked row by row)
- **Available in:** Excel 2024 and Microsoft 365
- **Category:** [Dynamic array functions](https://spreadsheetpractice.com/functions/category/dynamic-arrays)
- **Returns:** An array the same size as the inputs.
- **Google Sheets:** Available in Google Sheets.

## What it does

MAP runs a LAMBDA on each value of an array, or on matching values from several arrays, and returns an array of the same size. Use it for value-by-value logic that won't spill on its own, such as IF with AND or OR across two columns, which otherwise collapses to one TRUE or FALSE.

## Syntax

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

| Argument | Required? | What it is |
|---|---|---|
| `array1` | Required | The first array or range. |
| `array2` | Optional | Optional: more arrays the same size, whose values are passed alongside. |
| `lambda` | Required | A LAMBDA with one input per array. |

## Examples

Each result was calculated by running the formula on the sample sheet.

| Cell | Formula | Result | What it shows |
|---|---|---|---|
| D2 | `=MAP(B2:B4,C2:C4,LAMBDA(s,t,IF(AND(s>=t,s>10000),"Bonus","-")))` | Bonus (spills 3 × 1) | AND checked row by row |
| E2 | `=MAP(B2:B4,LAMBDA(s,ROUND(s/1000,1)))` | 12.5 (spills 3 × 1) | Each sale in thousands |
| F2 | `=SUM(MAP(B2:B4,C2:C4,LAMBDA(s,t,MAX(0,s-t))))` | $2,700 | Total sales above target |

### The sample sheet

Every formula above runs on this data:

|  | A | B | C | D | E | F |
|---|---|---|---|---|---|---|
| 1 | Rep | Sales | Target | Result |  |  |
| 2 | Ana | $12,500 | $10,000 | Bonus | 12.5 | $2,700 |
| 3 | Raj | $8,800 | $9,000 | - | 8.8 |  |
| 4 | Lee | $15,200 | $15,000 | Bonus | 15.2 |  |

## Common mistakes

| What you see | Why, and how to fix it |
|---|---|
| One TRUE or FALSE instead of one per row | That's AND or OR without MAP: they combine the whole array. MAP applies them to each row. |
| #VALUE! | The LAMBDA has a different number of inputs from the number of arrays. |
| #N/A in some results | The arrays aren't the same size. |

## Tips

- When each row needs AND or OR, MAP keeps them per row: =MAP(A2:A9,B2:B9,LAMBDA(a,b,AND(a>0,b>0))).

## Related functions

- [BYROW](https://spreadsheetpractice.com/functions/byrow): BYROW runs a LAMBDA on each row of a range and returns one result per row, all from one spilling formula.
- [LAMBDA](https://spreadsheetpractice.com/functions/lambda): LAMBDA creates your own function from a formula: name the inputs, then write the calculation, as in LAMBDA(price, rate, price*(1+rate)).
- [IF](https://spreadsheetpractice.com/functions/if): IF checks a condition and returns one value when it is true and another when it is false.

## Questions

### How do I use IF with AND on a whole column at once?

=MAP(B2:B100,C2:C100,LAMBDA(s,t,IF(AND(s>=t,s>0),"Yes","No"))) checks AND row by row.

### What is the difference between MAP and BYROW?

MAP works on single values; BYROW hands the LAMBDA a whole row at a time.

## Practice

A graded MAP exercise ("Flag both conditions") is on [the MAP page](https://spreadsheetpractice.com/functions/map). It is checked instantly, then re-checked on changed data.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
