Ravindra BagaleCourses & study guides Track your progress

Excel MAP Function

Chala mitrano — today we learn MAP. Read Why → What → How, then try the practice list.

Version note. Microsoft 365. Needs LAMBDA. Not in Excel 2019 / 2016.
Fictional sample data for learning. Fictional sample data for learning. Nashik kirana and Leeds cafe. Mixed ₹ and £.

Purpose

Apply a LAMBDA to every value in one or more arrays and spill the results.

Return value

An array the same shape as the mapped inputs (or combined shape when multiple arrays).

Syntax

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

Arguments

ArgumentRequired?Description
array1RequiredFirst array or range to walk through.
array2…OptionalMore arrays of the same size (paired by position).
lambdaRequiredA LAMBDA that receives one value from each array and returns a result.

Version

Microsoft 365. Needs LAMBDA. Not in Excel 2019 / 2016.

How to use — Why → What → How

Why: You want to change every price or every score with the same rule, without dragging a formula.

What: MAP walks each item, runs your LAMBDA, and spills a new array.

How — numbered steps:

  1. Write a small LAMBDA that takes one value, example: LAMBDA(x, x*1.18).
  2. Wrap it: =MAP(B2:B6, LAMBDA(x, x*1.18)).
  3. Press Enter and clear cells below/right so the spill fits.
  4. For two arrays: =MAP(qty, price, LAMBDA(q,p, q*p)).
  5. Name the LAMBDA in Name Manager if you reuse it often.

Ravindra Bagale's Tip

Friends, keep the LAMBDA short. Long MAP bodies are hard to read — use LET inside the LAMBDA if needed.

Ravindra Bagale's Tip

MAP needs equal-sized arrays when you pass more than one. Mismatch → #VALUE!.

Worked examples

1) Add 18% GST to a price list (₹)

Nashik kirana: prices in B2:B4.

ItemPrice
Atta48
Oil160
Soap35
Formula: =MAP(B2:B4, LAMBDA(p, p*1.18))

Result: 56.64, 188.8, 41.3

What it means: Each price × 1.18 spills down.

2) Line totals from qty × price

Priya packs boxes: qty C2:C4, price D2:D4.

Formula: =MAP(C2:C4, D2:D4, LAMBDA(q,p, q*p))

Result: Product per row

What it means: Two arrays, one LAMBDA with two parameters.

3) UK cafe tips (£)

Emma adds 10% tip on bills E2:E3.

Formula: =MAP(E2:E3, LAMBDA(b, ROUND(b*1.1,2)))

Result: Rounded tip-inclusive totals

What it means: Combine MAP with ROUND inside LAMBDA.

4) Pass / Fail labels

Scores F2:F5; pass if ≥40.

Formula: =MAP(F2:F5, LAMBDA(s, IF(s>=40,"Pass","Fail")))

Result: Pass/Fail spill

What it means: MAP can return text too.

5) Clean trim each name

Names with spaces in A2:A6.

Formula: =MAP(A2:A6, LAMBDA(n, TRIM(n)))

Result: Trimmed names

What it means: Same idea as dragging TRIM, but one spill.

About this data. Small demo rows for learning. Real sheets are longer; the same formula pattern scales when columns are clean.

Common errors

#CALC! / LAMBDA issues: LAMBDA missing or wrong parameter count.
#VALUE!: Arrays different sizes when mapping several arrays.
#SPILL!: Something blocks the output range.

Practice tasks (10+)

  1. Task 1. Map prices A2:A8 × 1.05 (5% hike).
    Hint: try on a tiny range first
  2. Task 2. Map two columns qty and rate into line totals.
    Hint: try on a tiny range first
  3. Task 3. Map scores to Grade: ≥75 A, ≥50 B, else C.
    Hint: try on a tiny range first
  4. Task 4. Map a list of city names to UPPER.
    Hint: try on a tiny range first
  5. Task 5. Map amounts in £ to ₹ using a rate cell (absolute ref inside LAMBDA carefully).
    Hint: try on a tiny range first
  6. Task 6. Wrap MAP in LET for the rate name.
    Hint: try on a tiny range first
  7. Task 7. Explain why MAP beats dragging for interviews.
    Hint: try on a tiny range first
  8. Task 8. Cause a #SPILL! on purpose, then clear the block.
    Hint: try on a tiny range first
  9. Task 9. Map with three arrays (a+b+c) if your build allows.
    Hint: try on a tiny range first
  10. Task 10. Bonus: MAP + TEXT to format as ₹#,##0.00.
    Hint: try on a tiny range first

Quick quiz

Q1. MAP always needs a LAMBDA as the last argument.
Q2. MAP is available in Excel 2016 by default.
Q3. Two input arrays should be the same size.
Q4. #SPILL! means the output range is blocked.

Answers: Q1=True, Q2=False, Q3=True, Q4=True

Related: LAMBDA · LET · GROUPBY · Function hub · Learning path