
π This article includes 1 downloadable practice file β
VLOOKUP breaks when columns move, can’t look left and counts columns by hand. INDEX/MATCH fixes all three and works in every Excel version, which is why analysts swear by it even now that XLOOKUP exists.
In this article
MATCH: where is it?
=MATCH("P103", A2:A50, 0) ' position of P103 in the list, e.g. 3
The 0 means exact match. MATCH returns a position, not a value.
INDEX: what’s at that position?
=INDEX(C2:C50, 3) ' the 3rd value in C2:C50
Together
=INDEX(C2:C50, MATCH(F2, A2:A50, 0)) ' price for the code in F2
Return column (C) and lookup column (A) are separate ranges, so inserting columns can’t break it, and the return column can be left of the lookup column.
Two-way lookup
=INDEX(B2:M20, MATCH(P2, A2:A20, 0), MATCH(P3, B1:M1, 0)) ' row by product, column by month
Multiple criteria
=INDEX(D2:D500, MATCH(1, (A2:A500=G2) * (B2:B500=G3), 0))
Multiplying conditions gives 1 only where both are true. In Excel 2019 and older, confirm with Ctrl+Shift+Enter.
Approximate match
MATCH(B2, Limits, 1) finds the band for a value in an ascending list of lower limits (slabs, grades).
XLOOKUP vs INDEX/MATCH
| INDEX/MATCH | XLOOKUP | |
|---|---|---|
| Works in | Every version | 365 / 2021+ |
| Readability | Two functions | One function |
| Not-found message | Wrap in IFNA | Built in |
| Two-way | Natural | Nested XLOOKUP |
Use XLOOKUP when everyone has Excel 365; INDEX/MATCH when files go to people on older versions. See two-way lookups.
Test formulas dynamically in our web formula laboratory or download the companion Excel workbook.
π Practice files for this article
- πLookup scenarios workbookVLOOKUP, HLOOKUP, INDEX/MATCH and XLOOKUP side by side β vertical, horizontal, two-way β plus 6 real failure cases and their fixes, with PASS/FAIL checks.β¬ XLSX Β· 10 KB
Free to use for learning. Files with macros (.bas) are plain text β import them with Alt+F11 β File β Import File, and always test on a copy.
Atul (AJ) builds office-automation and local-first AI tools as Atulya AI, and works with Excel, SAP and Oracle EPM every day. He writes about the shortcuts, macros and automations that actually save time β plus the occasional wacky fact. Videos on YouTube: Lazy Automator AI (@LazyAutomatorAI).
More posts by Atul βStuck on a step? Ask a question and the AI answers using this article.