Mastering the MAP Function in Excel 365 – Explained with Examples


🧠 What is the MAP Function in Excel 365?

The MAP function is a Lambda helper function in Excel 365 that lets you apply a custom formula (Lambda) to each element of one or more arrays.

It’s similar to the “map” concept in programming — you pass in arrays, and MAP processes each corresponding item across those arrays using your custom logic.


🔧 Syntax of MAP

=MAP(array1, [array2], ..., lambda(value1, [value2], ..., calculation))
ParameterDescription
array1The first array to apply the function to
array2(Optional) Additional arrays
lambdaA custom function that defines what to do with each item in the array(s)

✅ Key Features

  • Processes each item in an array (or matching items from multiple arrays)
  • Great for row-wise transformations, custom logic, or string manipulation
  • Fully dynamic and compatible with spilled ranges
  • Ideal for creating reusable custom logic without VBA

🔍 Examples of MAP in Action


🔹 Example 1: Add 10 to Each Number

If A1:A5 = {5, 10, 15, 20, 25}

=MAP(A1:A5, LAMBDA(x, x + 10))

✅ Output: {15, 20, 25, 30, 35}


🔹 Example 2: Combine Names from Two Columns

AB
RaviSharma
PriyaMehta
AkashVerma
=MAP(A2:A4, B2:B4, LAMBDA(f, l, f & " " & l))

✅ Output:
Ravi Sharma
Priya Mehta
Akash Verma


🔹 Example 3: Apply IF Logic to Array

Add 100 if value > 50, else keep it unchanged:

=MAP(A1:A5, LAMBDA(x, IF(x > 50, x + 100, x)))

🔹 Example 4: Format Text to Title Case (First letter capital)

Assume names in A2:A4:

=MAP(A2:A4, LAMBDA(n, UPPER(LEFT(n,1)) & LOWER(MID(n,2,LEN(n)))))

✅ Transforms “rAVI” into “Ravi”


📌 Real-World Use Cases

  • Process data row-by-row or column-by-column
  • Apply different logic to multiple inputs
  • Create advanced conditional formatting via formulas
  • Perform string cleanup, name formatting, score adjustments
  • Replace helper columns with dynamic logic

❓ Interview-Style Question

Question:
You’re given two arrays:
Array1 = {10, 20, 30, 40}
Array2 = {1, 2, 3, 4}

Write a formula using MAP that multiplies each pair of values from Array1 and Array2.

Answer:

=MAP({10, 20, 30, 40}, {1, 2, 3, 4}, LAMBDA(a, b, a * b))

✅ Output: {10, 40, 90, 160}


🎓 Want to Master Lambda & MAP in Real Scenarios?

Learn how to use MAP, REDUCE, SCAN, LAMBDA, and other Excel 365 functions with dashboards, custom tools, and real case studies in:

👉 Mastering MS Excel – A Comprehensive Training Course