"INDEX()" and "MATCH()" are often used together to create flexible lookup formulas. Before "XLOOKUP()", this combination was one of the most popular alternatives to "VLOOKUP()".
๐ How Does It Work?
Think of it this way:
๐ "MATCH()" โ Finds where the value is.
๐ "INDEX()" โ Returns what is at that position.
Together:
=INDEX(return_range,MATCH(lookup_value,lookup_range,0))
๐ Example โ Find an Employee's Salary
Employee Department Salary
Rahul IT 60000
Priya HR 55000
Amit Finance 70000
Neha Marketing 65000
Suppose cell E2 contains: "Amit"
Formula:
=INDEX(C2:C5,MATCH(E2,A2:A5,0))
Result: 70000
๐ Step-by-Step
First, "MATCH()" searches for Amit:
=MATCH(E2,A2:A5,0)
Result: 3
Amit is the 3rd employee in the range.
Then "INDEX()" uses that position:
=INDEX(C2:C5,3)
Result: 70000
The combined formula performs both steps automatically.
๐ Why Use INDEX() + MATCH()?
Compared with traditional "VLOOKUP()":
โ Can look left or right.
โ Doesn't require a column index number.
โ More flexible when columns are inserted or rearranged.
โ Works well for dynamic lookup scenarios.
๐ Two-Way Lookup
"INDEX()" + "MATCH()" can also find a value based on both a row and a column.
Example:
Employee Jan Feb Mar
Rahul 50000 55000 60000
Priya 45000 50000 52000
Amit 60000 65000 70000
Suppose: E2 = Amit, F2 = Feb
Formula:
=INDEX(B2:D4,MATCH(E2,A2:A4,0),MATCH(F2,B1:D1,0))
Result: 65000
Here:
๐ First MATCH() finds the employee row.
๐ Second MATCH() finds the month column.
๐ INDEX() returns the value at their intersection.
๐ Real-World Uses
โข Employee salary lookup.
โข Product price lookup.
โข Customer information retrieval.
โข Monthly sales analysis.
โข Two-dimensional reporting.
โข Dynamic dashboards.
๐ INDEX + MATCH vs XLOOKUP
"INDEX() + MATCH()":
โข Very flexible.
โข Works in older Excel versions.
โข Excellent for advanced lookup logic.
"XLOOKUP()":
โข Easier to write.
โข Supports built-in "not found" handling.
โข Can perform both vertical and horizontal lookups.
โข Preferred in newer Excel versions.
๐ Common Mistakes
โ Forgetting the "0" in "MATCH()" for exact matching.
โ Using ranges with different sizes.
โ Referencing the wrong row or column range.
โ Best Practices
โข Use exact matching ("0") for most business lookups.
โข Keep lookup ranges consistent.
โข Use absolute references when copying formulas.
โข Use "XLOOKUP()" when it provides a simpler solution.
๐ก Remember:
MATCH() โ Find the position
INDEX() โ Return the value
INDEX + MATCH โ Find the right value dynamically
Mastering this combination is an important Excel skill for data analysts and interview preparation.
Double Tap โค๏ธ For More