๐ Excel Basics #23 โ MATCH() Function
The MATCH() function finds the position of a value within a range. It is especially powerful when combined with INDEX() to create flexible lookup formulas.
๐ What is the MATCH() Function?
MATCH() searches for a value and returns its relative position in a range.
Syntax:
=MATCH(lookup_value, lookup_array, [match_type])
The most commonly used option is:
0 โ Exact match
๐ Example 1 โ Find the Position
Consider:
A
Rahul
Priya
Amit
Neha
Formula:
=MATCH("Amit",A2:A5,0)
Result: 3
Why?
Within the range A2:A5:
1๏ธโฃ Rahul
2๏ธโฃ Priya
3๏ธโฃ Amit
4๏ธโฃ Neha
So Amit is in position 3.
๐ Example 2 โ Using a Cell Reference
If cell E2 contains "Priya":
=MATCH(E2,A2:A5,0)
Result: 2
This makes the lookup dynamic because changing E2 changes the result.
๐ MATCH() Match Types
The third argument controls how Excel searches.
0 โ Exact match
=MATCH(E2,A2:A10,0)
Use this for most business/data analysis scenarios.
1 โ Approximate match, assuming the lookup array is sorted ascending.
-1 โ Approximate match, assuming the lookup array is sorted descending.
โ ๏ธ For beginners, use 0 unless you specifically need approximate matching.
๐ INDEX() + MATCH()
This is where MATCH() becomes extremely useful.
Example:
Employee | Department | Salary
Rahul | IT | 60000
Priya | HR | 55000
Amit | Finance | 70000
Neha | Marketing | 65000
To find Amit's salary:
=INDEX(C2:C5,MATCH("Amit",A2:A5,0))
How it works:
๐ MATCH() finds Amit's position โ 3
๐ INDEX() returns the 3rd value from C2:C5 โ 70000
Result: 70000
๐ MATCH() vs XLOOKUP()
MATCH():
โข Returns the position.
โข Very useful with INDEX().
โข Useful when building dynamic formulas.
XLOOKUP():
โข Directly returns the matching value.
โข Easier for many modern lookup tasks.
โข Available in newer Excel versions.
๐ Real-World Uses
โข Find the position of an employee.
โข Locate a product in a list.
โข Find the position of a month or column.
โข Build dynamic lookup formulas.
โข Combine with INDEX() for advanced data analysis.
๐ Common Mistakes
โ Forgetting the 0 for an exact match.
โ Using approximate matching on unsorted data.
โ Searching in the wrong range.
โ
Best Practices
โข Use 0 for exact matching in most cases.
โข Combine MATCH() with INDEX() for flexible lookups.
โข Keep the lookup range consistent with the data you're searching.
โข Use XLOOKUP() when you simply need to return a matching value.
๐ก Remember:
MATCH() answers:
๐ "Where is this value?"
INDEX() answers:
๐ "What value is at this position?"
Together, they form one of Excel's most powerful lookup combinations.
Double Tap โค๏ธ For More
Post #2247
2.95K
- โค 7
- ๐ 1