VLOOKUP with real examples, and when to use XLOOKUP instead
Five worked VLOOKUP examples, from a basic price lookup to tiered commission rates, plus the XLOOKUP version of each and the mistakes that return wrong answers silently.

VLOOKUP finds a value in the first column of a table and returns something from the same row. It is the most used lookup in Excel and the source of more silent errors than any other function. Here it is with real examples. To skip straight to a correct formula for your own columns, use the VLOOKUP Generator or the XLOOKUP Generator.
The syntax
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])- lookup_value: what you are looking for, usually a cell such as A2.
- table_array: the table to search. VLOOKUP always searches its first column.
- col_index_num: which column of that table to return, counting the first as 1.
- range_lookup: FALSE for an exact match, TRUE (or left out) for an approximate match.
The last argument is the one that bites. Leave it out and VLOOKUP assumes TRUE, approximate match on sorted data. On unsorted data that returns plausible wrong answers with no error. Always type FALSE unless you specifically want the tier behaviour in example 3.
Example 1: a price lookup
A Products sheet has codes in column A and prices in column C. On an Orders sheet, the code is in A2:
=VLOOKUP(A2, Products!$A$2:$C$500, 3, FALSE)Read it as: find A2 in the first column of Products!A2:C500, return the 3rd column, exact match only. The $ signs keep the table fixed when you fill the formula down.
Example 2: show a message instead of #N/A
When a code is not in the price list, VLOOKUP returns #N/A, which then breaks any total that includes it. Wrap it:
=IFNA(VLOOKUP(A2, Products!$A$2:$C$500, 3, FALSE), "Not found")Prefer IFNA to IFERROR here. IFERROR also hides genuine mistakes, such as a column number larger than the table, which you want to see. If you get #N/A for a code you can clearly see in the list, read why VLOOKUP returns #N/A when the value is there: it is almost always a hidden space or a number stored as text.
Example 3: approximate match for tiers
This is what approximate match is for. A commission table, sorted ascending by the first column:
| Sales from | Rate |
|---|---|
| 0 | 2% |
| 10,000 | 3% |
| 25,000 | 4% |
| 50,000 | 5% |
With the table in F2:G5 and a salesperson’s total in B2:
=VLOOKUP(B2, $F$2:$G$5, 2, TRUE)For 31,000 it returns 4%: the largest "Sales from" value that is not more than 31,000. The same pattern handles tax bands, shipping weights and grade boundaries. The table must be sorted, or the answer is wrong.
Example 4: look up from another workbook
=VLOOKUP(A2, '[Price list.xlsx]Sheet1'!$A$2:$C$500, 3, FALSE)Excel writes this path for you if you click into the other workbook while typing the formula. If the other file is closed, Excel keeps the last values it read; Data → Edit Links updates them.
Example 5: return several columns
To return price (column 3) and stock (column 4) side by side, either write two formulas with 3 and 4, or in Microsoft 365 return both at once:
=VLOOKUP(A2, Products!$A$2:$D$500, {3,4}, FALSE)The result spills into two cells.
The limitation everyone hits
VLOOKUP can only return columns to the right of the one it searches, and the column number is a fixed count. Insert a column inside the table and every VLOOKUP returning a column beyond it now returns the wrong one, silently.
The XLOOKUP versions
XLOOKUP (Microsoft 365, Excel 2021 and later) fixes all of this:
=XLOOKUP(A2, Products!$A$2:$A$500, Products!$C$2:$C$500, "Not found")- exact match by default, so the missing FALSE problem disappears;
- separate search and return ranges, so it can look left and survives inserted columns;
- a built-in "not found" value, so no IFNA needed.
The tier lookup from example 3 becomes:
=XLOOKUP(B2, $F$2:$F$5, $G$2:$G$5, , -1)where -1 means "exact match, or the next smaller value". The table no longer even has to be sorted.
Which should you use?
- Your workbook will be opened in Excel 2019 or older: VLOOKUP, or INDEX/MATCH, which works in every version and can look left.
- Everyone has Microsoft 365 or Excel 2021+: XLOOKUP.
- Google Sheets: both VLOOKUP and XLOOKUP work.
Our comparison of XLOOKUP and INDEX/MATCH goes deeper. Whichever you write, the Formula Checker flags approximate-match VLOOKUPs and column numbers outside the table before they cost you.


