Account 10457 is not in the list. I checked. But VLOOKUP gave me a balance for it anyway: 48,250. No error, no warning. That's the balance of account 10452, a completely different client.
This is the most dangerous thing in Excel: a formula that's wrong and looks right. Below are the four VLOOKUP traps I've seen most often in banking reports, how XLOOKUP fixes them, and a live sheet for each one, so you can break the formulas yourself. The video above shows the same four traps in Excel, step by step.
The setup: two reports to reconcile
We have an account list from the core system, and a report with account IDs. We need the balance for each ID. It's the task behind every reconciliation: take a key from one report and find it in another.
The correct VLOOKUP needs four things:
=VLOOKUP(A2, $A$5:$C$12, 3, FALSE)
- What to look for: the account ID in A2.
- Where: the whole table. Press F4 after selecting it to add the
$signs, so the range stays put when you copy the formula down. - Which column to return: the balance is the 3rd column of the table, so
3. FALSE: exact match. Remember this word, because trap 1 is about it.
Trap 1: forgetting FALSE
The last argument of VLOOKUP is optional, so people leave it out. Without it, VLOOKUP does an approximate match: if it can't find 10457, it quietly takes the closest smaller ID, 10452, and returns that client's balance.
{"cells": {"A1": "Find", "B1": "No FALSE", "C1": "With FALSE", "D1": "XLOOKUP", "A2": 10457, "B2": "=VLOOKUP(A2,$A$5:$C$12,3)", "C2": "=VLOOKUP(A2,$A$5:$C$12,3,FALSE)", "D2": "=XLOOKUP(A2,$A$5:$A$12,$C$5:$C$12,\"Not found\")", "C4": "Balance", "A4": "Account ID", "B4": "Client", "A5": 10214, "B5": "Alder Trading", "C5": 12840.5, "A6": 10301, "B6": "Cedar Foods", "C6": 3415.75, "A7": 10388, "B7": "Elm Studio", "C7": 9205, "A8": 10452, "B8": "Granite Build", "C8": 48250, "A9": 10479, "B9": "Harbor Cafe", "C9": 1930.15, "A10": 10515, "B10": "Iris Travel", "C10": 22640.8, "A11": 10533, "B11": "Juniper Farms", "C11": 71005.6, "A12": 10598, "B12": "Linden Books", "C12": 6312.45}, "formats": {"B2:D2": {"fmt": "number", "dec": 2}, "C5:C12": {"fmt": "number", "dec": 2}}, "focus": "B2", "rows": 13, "note": "10457 isn't in the list, but B2 still shows a balance. Type 10388 in A2: now all three agree. Then try 99999."}
Two things to notice:
#N/Ain C2 is good news. It means "not found", and that's the truth.- Try 99999 in A2. VLOOKUP without FALSE returns the balance of the last account in the list, because every ID is smaller than 99999.
In a report with thousands of rows, nobody will ever spot a wrong balance like that. Rule number one: with VLOOKUP, always finish with FALSE (or 0, it means the same).
XLOOKUP does an exact match by default, so this trap simply doesn't exist there.
Trap 2: a new column breaks the formula
VLOOKUP counts columns by number. Your formula says "return column 3", and it keeps saying that after someone in IT adds a Currency column to the export, right before the balance. Column 3 is now the currency.
{"cells": {"A1": "Find", "B1": "VLOOKUP", "C1": "XLOOKUP", "A2": 10388, "B2": "=VLOOKUP(A2,$A$5:$D$10,3,FALSE)", "C2": "=XLOOKUP(A2,$A$5:$A$10,$D$5:$D$10,\"Not found\")", "C4": "Currency", "D4": "Balance", "A4": "Account ID", "B4": "Client", "A5": 10214, "B5": "Alder Trading", "C5": "EUR", "D5": 12840.5, "A6": 10301, "B6": "Cedar Foods", "C6": "EUR", "D6": 3415.75, "A7": 10388, "B7": "Elm Studio", "C7": "USD", "D7": 9205, "A8": 10452, "B8": "Granite Build", "C8": "EUR", "D8": 48250, "A9": 10479, "B9": "Harbor Cafe", "C9": "GBP", "D9": 1930.15, "A10": 10515, "B10": "Iris Travel", "C10": "EUR", "D10": 22640.8}, "formats": {"C2": {"fmt": "number", "dec": 2}, "D5:D10": {"fmt": "number", "dec": 2}}, "focus": "B2", "rows": 11, "note": "The VLOOKUP was written before the Currency column existed. Change its 3 to 4 to fix it."}
Here you at least get "USD" instead of a number, so it's easy to see. In the video the new column is empty, and VLOOKUP returns 0: a perfectly normal-looking balance. Again, no error.
XLOOKUP doesn't care. It points at the balance column itself ($D$5:$D$10), not at "column number 3", so inserting or deleting columns never moves its target.
If you have to stay with VLOOKUP, replace the typed column number with MATCH on the header row, so the number updates itself: =VLOOKUP(A2, $A$5:$D$10, MATCH("Balance", $A$4:$D$4, 0), FALSE). The same idea, for many columns at once, is in VLOOKUP for multiple columns.
Trap 3: VLOOKUP can't look to the left
Now we have a client's name and need the account ID. The name is in column B, the ID is in column A, to the left. VLOOKUP always searches the first column of the table and can only return columns to the right of it, so it simply can't do this.
{"cells": {"A1": "Client", "B1": "XLOOKUP", "C1": "INDEX/MATCH", "A2": "Juniper Farms", "B2": "=XLOOKUP(A2,$B$5:$B$12,$A$5:$A$12,\"Not found\")", "C2": "=INDEX($A$5:$A$12,MATCH(A2,$B$5:$B$12,0))", "C4": "Balance", "A4": "Account ID", "B4": "Client", "A5": 10214, "B5": "Alder Trading", "C5": 12840.5, "A6": 10301, "B6": "Cedar Foods", "C6": 3415.75, "A7": 10388, "B7": "Elm Studio", "C7": 9205, "A8": 10452, "B8": "Granite Build", "C8": 48250, "A9": 10479, "B9": "Harbor Cafe", "C9": 1930.15, "A10": 10515, "B10": "Iris Travel", "C10": 22640.8, "A11": 10533, "B11": "Juniper Farms", "C11": 71005.6, "A12": 10598, "B12": "Linden Books", "C12": 6312.45}, "formats": {"C5:C12": {"fmt": "number", "dec": 2}}, "focus": "B2", "rows": 13, "note": "Type another client name in A2, for example Elm Studio."}
The classic workaround is INDEX/MATCH (C2): MATCH finds the row of the name, INDEX takes the ID from that row. It works in every Excel version, but it's two functions inside each other.
With XLOOKUP you just say where to look ($B$5:$B$12) and what to return ($A$5:$A$12). Left, right, it doesn't matter.
Trap 4: numbers stored as text
The trap that wastes the most time in real life. Account 10515 is in the list, both formulas say it isn't, and the formula is perfect.
Look at the ID itself. In Excel it has a small green triangle in the corner, and it sits on the left of the cell. Numbers sit on the right. This 10515 is text, not a number. It happens all the time when data comes from another system or a CSV file. For Excel, the text "10515" and the number 10515 are two different things, so no lookup function will match them.
{"cells": {"A1": "Find", "B1": "Is number?", "C1": "VLOOKUP", "D1": "XLOOKUP", "A2": "=\"10515\"", "B2": "=ISNUMBER(A2)", "C2": "=VLOOKUP(A2,$A$5:$C$8,3,FALSE)", "D2": "=XLOOKUP(A2,$A$5:$A$8,$C$5:$C$8,\"Not found\")", "C4": "Balance", "A4": "Account ID", "B4": "Client", "A5": 10388, "B5": "Elm Studio", "C5": 9205, "A6": 10452, "B6": "Granite Build", "C6": 48250, "A7": 10515, "B7": "Iris Travel", "C7": 22640.8, "A8": 10598, "B8": "Linden Books", "C8": 6312.45}, "formats": {"C2:D2": {"fmt": "number", "dec": 2}, "C5:C8": {"fmt": "number", "dec": 2}}, "focus": "A2", "rows": 9, "note": "A2 holds 10515 as text, like an ID from a CSV file. Type the number 10515 over it and both lookups find Iris Travel."}
How to fix it:
- One cell or a whole column: select it, click the yellow warning icon next to it, and choose Convert to Number.
- A whole column without clicking: select it and use Data → Text to Columns → Finish.
- Leave the data alone and fix the formula: turn the lookup value into a number with two minus signs:
=VLOOKUP(--A2, $A$5:$C$8, 3, FALSE). If the IDs in the table are text and your value is a number, do the opposite:=VLOOKUP(A2&"", …).
=ISNUMBER(A2) is the quickest test when a lookup "can't find" something you can see with your own eyes. More silent bugs like this one in How to fix Excel errors.
VLOOKUP vs XLOOKUP at a glance
| VLOOKUP | XLOOKUP | |
|---|---|---|
| Default match | Approximate (unless you add FALSE) |
Exact |
| Return column | A typed number, breaks when columns move | The column itself, never moves |
| Look to the left | No | Yes |
| Not found | #N/A (wrap in IFNA for a message) |
Built-in 4th argument: "Not found" |
| Numbers stored as text | No match | No match |
| Works in | Every Excel version | Excel 2021, 2024, Microsoft 365, Excel for the web |
Quick quiz: what does each lookup return?
Eight lookups on one small table. Some return an error. The dangerous ones don't.
{"title": "Quick quiz: VLOOKUP or trap?",
"intro": "IDs in A2:A6: 10214, 10388, 10452, 10515, 10598. Balances in B2:B6. Pick what each formula returns.",
"choices": ["#N/A", "#REF!", "#VALUE!", "No error"],
"questions": [
{"f": "=VLOOKUP(10457,A2:B6,2)", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "No error", "why": "It returns 48,250, the balance of 10452. Without FALSE, VLOOKUP takes the closest smaller ID. No error is the problem here."},
{"f": "=VLOOKUP(10457,A2:B6,2,FALSE)", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "#N/A", "why": "10457 isn't in the list, and with FALSE VLOOKUP says so honestly."},
{"f": "=VLOOKUP(10388,A2:B6,3,FALSE)", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "#REF!", "why": "The table A2:B6 has two columns, and the formula asks for the 3rd."},
{"f": "=XLOOKUP(10457,A2:A6,B2:B6)", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "#N/A", "why": "XLOOKUP looks for an exact match by default. Without the 4th argument, *not found* is `#N/A`."},
{"f": "=XLOOKUP(10457,A2:A6,B2:B6,\"Not found\")", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "No error", "why": "It shows the text Not found. That's the 4th argument doing its job."},
{"f": "=VLOOKUP(\"10388\",A2:B6,2,FALSE)", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "#N/A", "why": "\"10388\" in quotes is text, and the IDs are numbers. They look the same, but they never match."},
{"f": "=VLOOKUP(10100,A2:B6,2)", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "#N/A", "why": "Even an approximate match needs a smaller ID to fall back on, and 10100 is smaller than all of them."},
{"f": "=VLOOKUP(99999,A2:B6,2)", "cells": {"A2": 10214, "A3": 10388, "A4": 10452, "A5": 10515, "A6": 10598, "B2": 12840.5, "B3": 9205, "B4": 48250, "B5": 22640.8, "B6": 6312.45}, "a": "No error", "why": "It returns 6,312.45, the last balance in the list, because every ID is smaller than 99999. A made-up ID, a real-looking answer."}
],
"verdicts": [
{"min": 8, "text": "**Lookup pro.** No VLOOKUP can fool you. 🏆"},
{"min": 6, "text": "**Sharp eye.** Only the sneakiest ones got you. 💪"},
{"min": 4, "text": "**Getting there.** Re-read trap 1, it's the one that costs money."},
{"min": 0, "text": "**VLOOKUP is sneaky.** Watch the video above, then try again."}
]}
Which one should you use?
Use XLOOKUP if everyone who opens the file has Excel 2021, 2024 or Microsoft 365. It fixes traps 1, 2 and 3 by design, and its "not found" message is easier to read than #N/A.
Use VLOOKUP with FALSE (or INDEX/MATCH) when the file goes to people with older Excel. In Excel 2016 or 2019, XLOOKUP shows #NAME?, because that version doesn't know the function.
Trap 4 catches both of them. When a lookup can't find something you can clearly see, check for numbers stored as text first.
Practise it
Every exercise is a real sheet with instant feedback on your formula:
- XLOOKUP: exact match, the "not found" argument, and lookups to the left
- VLOOKUP: the four arguments, with FALSE
- INDEX and MATCH: the lookup that works in every Excel version
- ISNUMBER: catch numbers stored as text
- IFERROR: a friendly message instead of an error
Next: compare two columns in Excel to find which IDs are missing from a report before you look them up.