VLOOKUP returns the wrong value: how to fix it
Updated · Checked on a live sheet · Excel and Google Sheets
The most likely fix
A wrong result with no error almost always means VLOOKUP did an approximate match: its last argument was left out, so it defaulted to TRUE and assumed the first column is sorted. Add FALSE as the fourth argument and VLOOKUP returns the exact match, or #N/A if there isn't one.
Fix it yourself
The formula in M2 shows the problem. Edit it to the fixed version and watch the sheet recalculate.
| G | H | I | J | K | L | M | |
|---|---|---|---|---|---|---|---|
| 1 | SKU | Product | Price | Stock | SKU | SL-401 | |
| 2 | PL-101 | Fern | $9.50 | 40 | Product | Ceramic pot | |
| 3 | PL-104 | Monstera | $34.00 | 12 | |||
| 4 | PL-107 | Snake plant | $22.00 | 25 | |||
| 5 | PT-210 | Terracotta pot | $12.50 | 60 | |||
| 6 | PT-212 | Ceramic pot | $19.00 | 18 | |||
| 7 | TL-301 | Watering can | $18.00 | 9 | |||
| 8 | SL-401 | Potting mix | $7.25 | 80 |
Shows the problem
=VLOOKUP(M1,G2:H8,2)Fixed
=VLOOKUP(M1,G2:H8,2,FALSE)Causes, most likely first
1Approximate match on unsorted data
Microsoft's VLOOKUP page: if the last argument is TRUE or left out, the first column needs to be sorted, otherwise the return value might be something you don't expect. In the sheet above, SL-401 is in the list as Potting mix, yet VLOOKUP returns “Ceramic pot”, because the SKU column isn't sorted (SL-401 comes after TL-301). With FALSE it returns Potting mix, and for a SKU that isn't there it returns #N/A, which is the truth. Use TRUE only on purpose, for brackets on a sorted table.
Wrong
=VLOOKUP(M1,G2:H8,2)Fixed
=VLOOKUP(M1,G2:H8,2,FALSE)2The column number is counted from the wrong place
The third argument counts columns inside the table you gave VLOOKUP, starting at 1 for its first column. For a table starting in G, column 2 is H, not B. Insert a column into the table and the number now points one column too far left. Let MATCH find the column by its header:
MATCH("Price", $G$1:$J$1, 0).Wrong
=VLOOKUP(B2,$G$2:$J$8,2,FALSE)Fixed
=VLOOKUP(B2,$G$2:$J$8,MATCH("Price",$G$1:$J$1,0),FALSE)3The table slid when the formula was copied
Without
$, each copy of the formula searches a table one row lower. Some rows then find the right key in a shifted table and return values from the wrong row, or miss it entirely. Lock the table:$G$2:$J$8(absolute references).Wrong
=VLOOKUP(B2,G2:J8,3,FALSE)Fixed
=VLOOKUP(B2,$G$2:$J$8,3,FALSE)4Duplicate keys in the first column
VLOOKUP returns the first match it finds. If a key appears twice, every lookup gets the first row's value, which may be the older or the wrong record. Find duplicates with COUNTIF (find duplicates), or use XLOOKUP with search mode -1 to take the last match instead.
Stop it happening again
End every exact lookup with FALSE, even when it seems to work without it: data that happens to be sorted today won't be after the next import. Keep lookup tables free of duplicate keys, or decide on purpose which match you want. Let MATCH find the return column by its header so inserting a column can't shift the result. And spot-check a lookup against one row you can verify by eye; a wrong value with no error only shows up when someone compares. Where everyone has Excel 2021 or later, Microsoft 365 or Google Sheets, XLOOKUP avoids the first two mistakes by design.
Questions
Why does VLOOKUP return a value from the row above?
With approximate match, VLOOKUP returns the last row whose key is smaller than or equal to the lookup value in what it assumes is sorted order. On unsorted data that is often a neighbour. Add FALSE and check the result again.
When is TRUE the right choice?
When the table lists boundaries in ascending order and you want the band a value falls in: grades from scores, a commission rate from a sales figure, a tax band from income. The lookups with multiple criteria and tiers guide has a live example.
In Google Sheets
Google Sheets' VLOOKUP has the same default: its help says is_sorted is TRUE (approximate match) if you leave it out, and that with TRUE the first column must be sorted ascending, otherwise you most likely get a wrong return value. The fixes are identical.
Why this happens
Approximate match exists for brackets: tax bands, grade boundaries, commission tiers, where you want the largest boundary at or below a value in a sorted table. On an unsorted list of codes it quietly returns neighbours. That's why a missing FALSE is the most expensive VLOOKUP mistake: it doesn't look like an error. XLOOKUP defaults to an exact match, which is one reason to prefer it where it's available; see VLOOKUP vs XLOOKUP and, for deliberate brackets, lookups with multiple criteria and tiers.
Sources
Official documentation the facts on this page were checked against.