INDEX vs MATCH in Excel: Key Differences & Real Examples (2026)
INDEX vs MATCH β Complete Guide π―
Excel ke do powerful functions jo alag-alag kaam karte hain, but combine karne pe VLOOKUP se bhi zyada powerful ban jaate hain. INDEX position se value nikaalta hai, MATCH value ki position dhundhta hai. Real employee data ke examples, syntax breakdown, aur interview questions ke saath. Data Insights par.
π Is Blog Mein Kya Sikhenge:
- π’ Basic: INDEX aur MATCH kya hain, kaise kaam karte hain
- π‘ Medium: INDEX Function β Position se value nikaalna
- π‘ Medium: MATCH Function β Value ki position dhundhna
- π΄ Advanced: INDEX + MATCH Combination β Ultimate lookup power
- π Comparison: INDEX vs MATCH β differences aur use cases
- π¬ Interview: Top asked questions
1. INDEX & MATCH β Introduction π’
π Definition: INDEX and MATCH are two SEPARATE Excel functions that do different jobs. INDEX returns a value from a range based on ROW/COLUMN number. MATCH returns the POSITION of a value in a range. Individually useful, but their real power comes when COMBINED β replacing VLOOKUP with more flexibility.
π― Samjho Hinglish Mein: Socho ek almari hai β INDEX bolo "3rd shelf ki 2nd item do" β item mil jaayegi. MATCH bolo "yeh notebook kaunsi shelf pe hai?" β position bata dega. Alag-alag simple hain, but combine karo toh magic! INDEX(items, MATCH("notebook", names, 0)) = "notebook dhundo aur uski position se item nikaalo". Yehi VLOOKUP ka smarter version hai.
π Quick Overview:
| Function | Purpose | Input | Output |
|---|---|---|---|
| INDEX | Get value from position | Range + Row/Col number | Actual value |
| MATCH | Find position of value | Value + Range | Position number |
| INDEX + MATCH | Lookup any value | Value to search | Related value β‘ |
2. INDEX Function β Get Value by Position π‘
π Definition: INDEX returns a value from a specific position in a range or array. Give it a range, row number, and optionally a column number β it returns the value at that intersection. Works in ANY direction. Very fast, doesn't have VLOOKUP's limitations.
π Sample Data (Employee Table):
| Row/Col | A | B | C | D |
|---|---|---|---|---|
| 1 | ID | Name | Department | Salary |
| 2 | 101 | Aarav | IT | 55000 |
| 3 | 102 | Ishita | HR | 72000 |
| 4 | 103 | Kabir | Finance | 65000 |
| 5 | 104 | Diya | IT | 58000 |
| 6 | 105 | Rohan | Marketing | 80000 |
π‘ Syntax:
=INDEX(array, row_num, [col_num])
# Parameters:
# array = range
from
where value chahiye (A2:D6)
# row_num = kaunsi row se value chahiye (1, 2, 3...)
# col_num = kaunsi column se value chahiye (optional)π» Formula Examples:
# Example 1: Get 3rd row, 2nd column value
=INDEX(A2:D6, 3, 2)
# Result: Kabir (3rd row, 2nd col in range A2:D6)
# Example 2: Get 1st row, 4th column value
=INDEX(A2:D6, 1, 4)
# Result: 55000 (Aarav's salary)
# Example 3: Get 5th row, 3rd column
=INDEX(A2:D6, 5, 3)
# Result: Marketing (Rohan's department)
# Example 4: Single column β no col_num needed
=INDEX(B2:B6, 4)
# Result: Diya (4th name in Names column)
# Example 5: Get entire row (returns array)
=INDEX(A2:D6, 2, 0)
# Result: 102 | Ishita | HR | 72000 (entire 2nd row)π Expected Output:
| Formula | Result | Explanation |
|---|---|---|
| =INDEX(A2:D6, 3, 2) | Kabir | Row 3, Col 2 |
| =INDEX(A2:D6, 1, 4) | 55000 | Row 1, Col 4 (Salary) |
| =INDEX(B2:B6, 4) | Diya | Single column, 4th value |
β’ β Any direction β left, right, up, down
β’ β Faster than VLOOKUP
β’ β Return entire row/column
β’ β Works with 2D arrays
β’ β οΈ But needs position number β kaise nikaalein? MATCH se!
3. MATCH Function β Find Position of Value π‘
π Definition: MATCH returns the POSITION NUMBER of a value in a range. Give it a value and a range β it tells you at which position (1st, 2nd, 3rd...) that value exists. Doesn't return the value itself β only its location. Perfect partner for INDEX.
π Sample Data (Same Employee Table):
| Row/Col | A | B | C | D |
|---|---|---|---|---|
| 1 | ID | Name | Department | Salary |
| 2 | 101 | Aarav | IT | 55000 |
| 3 | 102 | Ishita | HR | 72000 |
| 4 | 103 | Kabir | Finance | 65000 |
| 5 | 104 | Diya | IT | 58000 |
| 6 | 105 | Rohan | Marketing | 80000 |
π‘ Syntax:
=MATCH(lookup_value, lookup_array, [match_type])
# Parameters:
# lookup_value = kya dhundna hai (Kabir, 103, etc.)
# lookup_array = kaunse range mein dhundna hai (B2:B6)
# match_type = 0 = exact match (recommended)
# 1 = exact or next smaller (default, needs sorted asc)
# -1 = exact or next larger (needs sorted desc)π» Formula Examples:
# Example 1: Find position of "Kabir" in Name column
=MATCH("Kabir", B2:B6, 0)
# Result: 3 (Kabir 3rd position pe hai)
# Example 2: Find position of ID 104
=MATCH(104, A2:A6, 0)
# Result: 4 (104 chauthe position pe)
# Example 3: Find column position of "Salary" in header row
=MATCH("Salary", A1:D1, 0)
# Result: 4 (Salary 4th column pe)
# Example 4: Value not found
=MATCH("Manish", B2:B6, 0)
# Result: #N/A (Manish nahi hai list mein)
# Example 5: With IFERROR for safety
=IFERROR(MATCH("Manish", B2:B6, 0), "Not Found")
# Result: Not Foundπ Expected Output:
| Formula | Result | Explanation |
|---|---|---|
| =MATCH("Kabir", B2:B6, 0) | 3 | Position in range |
| =MATCH(104, A2:A6, 0) | 4 | ID position |
| =MATCH("Salary", A1:D1, 0) | 4 | Column position |
4. INDEX + MATCH β Ultimate Combination π΄
π Definition: INDEX + MATCH combination replaces VLOOKUP with more flexibility and power. MATCH finds the position of a value, INDEX uses that position to return the corresponding value from another column. Works in ANY direction, faster than VLOOKUP, and doesn't break when columns are added/deleted.
π‘ The Formula Structure:
=INDEX(return_column, MATCH(lookup_value, lookup_column, 0))
# Step-by-step logic:
# 1. MATCH finds position of value in lookup_column
# 2. INDEX uses that position to return value from return_column
# 3. Both columns must be same length!π Sample Data (Employee Table):
| ID (A) | Name (B) | Department (C) | Salary (D) |
|---|---|---|---|
| 101 | Aarav | IT | 55000 |
| 102 | Ishita | HR | 72000 |
| 103 | Kabir | Finance | 65000 |
| 104 | Diya | IT | 58000 |
| 105 | Rohan | Marketing | 80000 |
π» Combination Examples:
# Example 1: Get Kabir's salary (LEFT-to-RIGHT lookup)
=INDEX(D2:D6, MATCH("Kabir", B2:B6, 0))
# Step 1: MATCH("Kabir", B2:B6, 0) β 3
# Step 2: INDEX(D2:D6, 3) β 65000
# Result: 65000
# Example 2: REVERSE lookup β Get ID from Name (RIGHT-to-LEFT!)
# VLOOKUP can't do this, INDEX-MATCH easily does!
=INDEX(A2:A6, MATCH("Diya", B2:B6, 0))
# Result: 104 (Diya's ID)
# Example 3: Get department from ID
=INDEX(C2:C6, MATCH(105, A2:A6, 0))
# Result: Marketing (Rohan's department)
# Example 4: With error handling
=IFERROR(INDEX(D2:D6, MATCH("Manish", B2:B6, 0)), "Not Found")
# Result: Not Found
# Example 5: 2D Lookup (both row and column dynamic)
=INDEX(A2:D6,
MATCH(103, A2:A6, 0), # row β find ID 103
MATCH("Salary", A1:D1, 0)) # col β find "Salary"
# Result: 65000 (Kabir's Salary β dynamically found)π Expected Output:
| Formula | Result | Power |
|---|---|---|
| =INDEX(D2:D6, MATCH("Kabir", B2:B6, 0)) | 65000 | Standard lookup |
| =INDEX(A2:A6, MATCH("Diya", B2:B6, 0)) | 104 | REVERSE lookup β¨ |
| =INDEX(A2:D6, MATCH(103,A2:A6,0), MATCH("Salary",A1:D1,0)) | 65000 | 2D lookup β‘ |
5. INDEX vs MATCH β Comparison π
π Definition: Yeh dono different tools hain jo different purposes serve karte hain. Feature-by-feature comparison β kab INDEX use karo, kab MATCH, aur kab combination.
π Complete Comparison Table:
| Feature | INDEX | MATCH |
|---|---|---|
| Purpose | Get value from position | Get position of value |
| Input | Range + Row/Col number | Value + Range |
| Output | Actual value (any type) | Position number (integer) |
| Direction | Any direction β | Vertical or Horizontal |
| Return Type | Value or Array | Number only |
| Standalone Use | Yes (if position known) | Yes (for position check) |
| Best When Combined | Ultimate lookup power | Provides row/col to INDEX |
| Error on Failure | #REF! (invalid position) | #N/A (value not found) |
π» Same Task β Different Approaches:
# Task: Get Kabir's Salary
# INDEX alone β need to KNOW position manually
=INDEX(D2:D6, 3)
# Result: 65000 (but you had to count!)
# MATCH alone β only finds position, not value
=MATCH("Kabir", B2:B6, 0)
# Result: 3 (but that's just the position, not salary)
# COMBINATION β perfect solution!
=INDEX(D2:D6, MATCH("Kabir", B2:B6, 0))
# Result: 65000 (automatic position + value!)6. When to Use What π―
π Decision Guide:
| Scenario | Use | Why |
|---|---|---|
| Position pata hai, value chahiye | INDEX alone | Direct value retrieval |
| Value ka position chahiye | MATCH alone | Position lookup |
| Value se related value chahiye | INDEX + MATCH | Full lookup power |
| Reverse lookup (rightβleft) | INDEX + MATCH | VLOOKUP can't do this |
| 2D lookup (row + column) | INDEX + 2 MATCH | Dynamic row & column |
| Excel 365/2021+ | XLOOKUP (better) | Modern replacement |
| Older Excel versions | INDEX + MATCH | Better than VLOOKUP |
β’ β Any direction lookup β left, right, up, down
β’ β Faster on large data β MATCH does binary search options
β’ β Column insertion safe β no fragile column index
β’ β Smaller file size β Excel calculates faster
β’ β Flexible β 2D lookups possible
7. Common Mistakes β οΈ
- Wrong range size β
=INDEX(A2:D6, 10)β range mein 5 rows hain, 10 mangaa β #REF! error - Missing col_num for 2D range β
=INDEX(A2:D6, 3)without col β returns entire row (may be array error) - Position count wrong β headers include karna bhoolna β range se count karna hai, sheet se nahi
- match_type bhoolna β default 1 hai (approximate) β 0 explicitly likho for exact
- Case-sensitive nahi β "kabir" aur "Kabir" same treat hote hain β data validation zaroori
- Text vs Number β
=MATCH(103, A2:A6, 0)mein A2:A6 mein text "103" ho toh #N/A - Leading/trailing spaces β "Kabir " (space ke saath) match nahi hoga "Kabir" se β TRIM use karo
- Different range sizes β INDEX D2:D6 (5 items) but MATCH B2:B10 (9 items) β position mismatch, wrong results
- Absolute reference bhoolna β drag karne pe formula break β
$B$2:$B$6use karo - No error handling β value na mile toh #N/A β IFERROR wrap karo
π» Mistakes vs Correct Code:
# β MISTAKE 1: match_type default (approximate)
=MATCH("Kabir", B2:B6)
# Default = 1 (approximate) β wrong results
on unsorted data!
# β
FIX: Always specify 0 for exact match
=MATCH("Kabir", B2:B6, 0)
# β MISTAKE 2: Range size mismatch
=INDEX(D2:D6, MATCH("Kabir", B2:B10, 0))
# INDEX has 5 items, MATCH searches 9 items β wrong position!
# β
FIX: Same range size
=INDEX(D2:D6, MATCH("Kabir", B2:B6, 0))
# β MISTAKE 3: No absolute references (breaks when dragged)
=INDEX(D2:D6, MATCH(F2, B2:B6, 0))
# β
FIX: Use $ for fixed ranges
=INDEX($D$2:$D$6, MATCH(F2, $B$2:$B$6, 0))
# β MISTAKE 4: No error handling
=INDEX(D2:D6, MATCH("Manish", B2:B6, 0))
# Returns #N/A error
# β
FIX: Wrap with IFERROR
=IFERROR(INDEX(D2:D6, MATCH("Manish", B2:B6, 0)), "Not Found")8. Interview Questions π¬
Q1: INDEX aur MATCH mein kya difference hai?
Ans: INDEX ek POSITION-based function hai β range aur row/column number do, actual VALUE return karta hai. MATCH ek VALUE-based function hai β value aur range do, POSITION NUMBER return karta hai. Simple analogy: INDEX bolo "3rd item lao" β item milega. MATCH bolo "yeh item kaunse position pe hai?" β position milegi. Together they form a powerful lookup: MATCH finds position, INDEX retrieves value.
Q2: INDEX-MATCH VLOOKUP se better kyu hai?
Ans: Multiple reasons: (1) Any direction lookup β VLOOKUP sirf left-to-right, INDEX-MATCH kisi bhi direction. (2) Faster on large datasets β Excel less columns process karta hai. (3) Column insertion safe β VLOOKUP mein column add karo toh index number break hota hai, INDEX-MATCH direct column reference use karta hai. (4) 2D lookups possible β dono row aur column dynamic ho sakte hain. (5) Smaller file size β VLOOKUP entire table reference karta hai, INDEX-MATCH sirf specific columns. Interview mein yeh 5 points batao β depth show karta hai.
Q3: MATCH function ke match_type kya hain?
Ans: 3 match_types hain: (1) 0 = Exact match (recommended) β exact value dhundhta hai, na mile toh #N/A. (2) 1 = Exact or next smaller (default) β approximate match, data ASCENDING sorted honi chahiye. Useful for ranges (grade calculation). (3) -1 = Exact or next larger β approximate match, data DESCENDING sorted honi chahiye. Rule of thumb: 99% cases mein 0 use karo β safer, exact results. 1 aur -1 sirf specific numeric ranges mein use karo jaha data sorted ho.
Q4: INDEX se poori row ya column kaise return karo?
Ans: Poori row ke liye row_num do aur col_num mein 0 pass karo: =INDEX(A2:D6, 2, 0) β 2nd row ki poori row return karega. Poori column ke liye row_num mein 0: =INDEX(A2:D6, 0, 3) β 3rd column ki poori column. Modern Excel mein array as result show hota hai (spill). Old Excel mein Ctrl+Shift+Enter (CSE) formula lagana padta tha. Use case: SUM, AVERAGE calculations on dynamic rows/columns β =SUM(INDEX(A2:D6, 0, 4)) β Salary column ka total.
Q5: 2D lookup kaise karte hain INDEX-MATCH se?
Ans: Do MATCH functions use karo β ek row ke liye, ek column ke liye. Syntax: =INDEX(data_range, MATCH(row_value, row_range, 0), MATCH(col_value, col_range, 0)). Example: =INDEX(A2:D6, MATCH(103, A2:A6, 0), MATCH("Salary", A1:D1, 0)) β ID 103 (row) aur "Salary" (column) dynamic hain. Real use case: pivot-style tables jaha rows employees hain aur columns metrics β koi bhi employee ka koi bhi metric fetch kar sakte ho ek formula se.
Q6: INDEX-MATCH ki performance issues kaise fix karte hain?
Ans: Optimization tips: (1) Limit ranges β A2:A1000 not A:A β entire column search slow. (2) Binary search β sorted data pe MATCH mein 1 ya -1 use karo β MUCH faster than 0. (3) Absolute references β recalculation kam. (4) Helper columns β complex logic ko break down karo. (5) Excel Tables β structured references use karo. (6) Avoid volatile functions β OFFSET, INDIRECT se bacho jaha possible. (7) Consider XLOOKUP β Excel 365 mein built-in optimization hai. Large data (100K+ rows) mein Power Query preferred hai lookups ke liye.
Q7: XLOOKUP aa gaya hai, ab INDEX-MATCH kyu seekhein?
Ans: Valid question β but INDEX-MATCH abhi bhi relevant hai kyunki: (1) Backward compatibility β XLOOKUP sirf Excel 365/2021+ mein, saare offices mein nahi. (2) Legacy files β purane files mein INDEX-MATCH heavily use hoti hai β samajhna zaroori. (3) Interview questions β Excel interviews mein INDEX-MATCH classic question hai β Advanced Excel knowledge show karta hai. (4) Flexibility β kuch complex scenarios mein INDEX-MATCH still simpler. (5) Google Sheets mein bhi popular. (6) Foundation understanding β INDEX-MATCH samajh gaye toh XLOOKUP asaan lagega. Modern code mein XLOOKUP first choice, but INDEX-MATCH knowledge zaroori hai.
Q8: INDEX-MATCH mein #N/A error kaise handle karo?
Ans: Multiple approaches: (1) IFERROR wrap β =IFERROR(INDEX(D:D, MATCH(F2, B:B, 0)), "Not Found") β most common. (2) IFNA (Excel 2013+) β =IFNA(INDEX(...), "Not Found") β only catches #N/A specifically, better error handling. (3) ISNUMBER + MATCH combo β =IF(ISNUMBER(MATCH(F2, B:B, 0)), INDEX(D:D, MATCH(F2, B:B, 0)), "Not Found") β old school but explicit. (4) XLOOKUP alternative β built-in error handling with if_not_found parameter. Best practice: IFNA specific hai, IFERROR broad β use IFNA when possible.
9. Quick Cheat Sheet π
# ββββββββββββββββββββββββββββββββββββββ
# INDEX β Get value by position
# ββββββββββββββββββββββββββββββββββββββ
=INDEX(array, row_num, [col_num])
# Get 3rd row, 2nd column
=INDEX(A2:D6, 3, 2)
# Get entire row (col_num = 0)
=INDEX(A2:D6, 3, 0)
# ββββββββββββββββββββββββββββββββββββββ
# MATCH β Find position of value
# ββββββββββββββββββββββββββββββββββββββ
=MATCH(lookup_value, lookup_array, [match_type])
# Exact match (RECOMMENDED)
=MATCH("Kabir", B2:B6, 0)
# ββββββββββββββββββββββββββββββββββββββ
# INDEX + MATCH β Ultimate lookup
# ββββββββββββββββββββββββββββββββββββββ
# Standard lookup (any direction)
=INDEX(D2:D6, MATCH("Kabir", B2:B6, 0))
# Reverse lookup (right β left)
=INDEX(A2:A6, MATCH("Kabir", B2:B6, 0))
# 2D lookup (dynamic row + column)
=INDEX(A2:D6,
MATCH(103, A2:A6, 0),
MATCH("Salary", A1:D1, 0))
# With error handling
=IFERROR(INDEX(D2:D6, MATCH(F2, B2:B6, 0)), "Not Found")
# ββββββββββββββββββββββββββββββββββββββ
# GOLDEN RULES
# ββββββββββββββββββββββββββββββββββββββ
# 1. Always use 0 in MATCH for exact match
# 2. Same range size for INDEX and MATCH
# 3. Use absolute references ($)
when dragging
# 4. Wrap with IFERROR for #N/A handling
# 5. Modern Excel? Use XLOOKUP insteadβ’ π― INDEX β position se value nikaalta hai
β’ π― MATCH β value ki position dhundhta hai
β’ π₯ INDEX + MATCH β VLOOKUP ka smarter, faster, flexible alternative
β’ β οΈ Always use 0 in MATCH for exact match
β’ π‘ Modern Excel (365/2021+) mein XLOOKUP better hai β but INDEX-MATCH classic knowledge zaroori hai
β’ π― Interview mein INDEX-MATCH aata hai β advanced Excel skills show karta hai
Next: Data Insights Excel Topic Wise
Agle blog mein hum cover karenge: IF vs IFS β Conditional Logic Deep Dive. Kaise IF nested karte hain, IFS function kaise cleaner alternative hai, kab kya use karo β real examples aur interview questions ke saath. Excel ke aur advanced topics β SUMIF/SUMIFS, COUNT variations, FILTER, UNIQUE β Data Insights par upcoming.
Happy Learning & Keep Exploring! π
π¬ Comments (0)
Loading comments...