Excel VLOOKUP: How It Works, Common Errors, and When to Use XLOOKUP
Learn the Excel VLOOKUP syntax step by step, why you should almost always use FALSE, how to fix #N/A and #REF! errors, and when XLOOKUP is the better choice.
VLOOKUP finds a value in the first column of a table and returns a value from another column in the same row, using =VLOOKUP(lookup_value, table_array, col_index_num, FALSE). The single most important habit is ending the formula with FALSE, which tells Excel you want an exact match; leave it out and Excel quietly switches to approximate matching.
Below is how each argument works, a worked example, the errors you will actually run into, and when the newer XLOOKUP function is the better tool.
The VLOOKUP syntax, argument by argument
According to Microsoft’s VLOOKUP documentation, the function takes four arguments:
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
| Argument | What it means | Example |
|---|---|---|
| lookup_value | The value you are searching for | A2 or "Smith" |
| table_array | The range to search; the lookup value must be in its first column | $D$2:$G$500 |
| col_index_num | Which column of that range to return (1 = first column) | 3 |
| range_lookup | FALSE (or 0) for exact match, TRUE (or 1, or omitted) for approximate | FALSE |
Microsoft’s own example is =VLOOKUP("Smith",A1:B100,2,FALSE): look for “Smith” in column A and return the matching value from column B.
Exact match vs. approximate match
- FALSE (exact match): Excel returns the first row that exactly matches. If none does, you get
#N/A. The first column does not need to be sorted. - TRUE or omitted (approximate match): Excel returns the closest match. For this to work, the first column must be sorted. This mode is meant for things like tax brackets or grade bands, not for looking up IDs or names.
Because TRUE is the default, a formula without the fourth argument can return a plausible-looking but wrong result. Microsoft and the independent guides we consulted give the same advice: use FALSE unless you specifically want approximate matching.
A worked example
Say you have a product list in columns D to G (SKU, Name, Category, Price) and an order sheet with SKUs in column A. You want the price next to each order.
- Click the cell where the price should appear, for example
B2. - Type
=VLOOKUP(. - Click
A2(the SKU you want to find), then type a comma. - Select the product table
D2:G500and press F4 to make it absolute ($D$2:$G$500), then type a comma. Locking the range stops it from shifting when you copy the formula down. - Count the columns in the range: SKU is 1, Name 2, Category 3, Price 4. Type
4,. - Type
FALSE)and press Enter. - Drag the fill handle down to copy the formula to the remaining rows.
The finished formula is =VLOOKUP(A2,$D$2:$G$500,4,FALSE).
Fixing common VLOOKUP errors
#N/A when the value clearly exists
#N/A means Excel could not find a match. Microsoft’s #N/A troubleshooting page and Ablebits’ VLOOKUP error guide point to the same usual suspects:
- Numbers stored as text. If your lookup value is a number but the table holds the same digits as text (or the other way round), they will not match. A small green triangle in the top-left corner of a cell often signals a number stored as text; select the cells and choose Convert to Number. In a formula you can also force the type:
A2&""turns a number into text, and--A2turns text into a number. - Extra spaces. “Apple ” with a trailing space is not the same as “Apple”. Wrap the lookup value in
TRIM(), or clean the source column. Non-breaking spaces (common in data pasted from the web) can survive TRIM; a combination of SUBSTITUTE, CLEAN and TRIM is the usual fix. - A range that moved. If you copied the formula without locking
table_arraywith$, the range shifts down row by row and eventually misses the data. - The lookup column is not first. VLOOKUP only searches the leftmost column of
table_array.
If a missing value is expected, wrap the formula to show something friendlier: =IFERROR(VLOOKUP(A2,$D$2:$G$500,4,FALSE),"Not found"). Use this after you have ruled out the data problems above, otherwise it hides real errors.
#REF!
Microsoft notes that if col_index_num is greater than the number of columns in table_array, VLOOKUP returns #REF!. Either widen the range or lower the column number.
Wrong results after inserting a column
Because VLOOKUP identifies the return column by number, inserting or deleting a column inside the table can make an existing formula return the wrong column without any error. Excel Campus highlights this as one of VLOOKUP’s biggest practical weaknesses. Check your formulas after restructuring a table.
Partial matches with wildcards
With exact match (FALSE) and a text lookup value, VLOOKUP accepts wildcards. Per Microsoft, ? matches any single character, * matches any sequence of characters, and a tilde (~) in front of either finds a literal question mark or asterisk.
Spreadsheeto’s example =VLOOKUP(E2&"*",A2:B6,2,FALSE) returns the first entry that starts with whatever is in E2. Keep in mind that VLOOKUP returns the first row that fits the pattern, so a loose pattern can grab the wrong row.
VLOOKUP vs. XLOOKUP
XLOOKUP was built to fix most of VLOOKUP’s limitations. Its syntax, from Microsoft’s XLOOKUP documentation, is:
=XLOOKUP(lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode])
Only the first three arguments are required. The same price lookup becomes =XLOOKUP(A2,$D$2:$D$500,$G$2:$G$500).
| VLOOKUP | XLOOKUP | |
|---|---|---|
| Default match | Approximate (TRUE) | Exact (match_mode 0) |
| Return column | Must be to the right, chosen by number | Any range, left or right |
| Inserting columns | Can break the formula | Unaffected, because it uses ranges |
| Not-found message | Needs IFERROR | Built-in if_not_found argument |
| Wildcards | Automatic with FALSE | match_mode 2 |
| Availability | All Excel versions | Newer versions only (see below) |
Which versions have XLOOKUP?
As of November 2026, Microsoft’s XLOOKUP page lists Excel for Microsoft 365, Excel 2024 and Excel 2021 among the versions it applies to. Sources disagree about older perpetual versions: the “Applies to” list on the page has at times included Excel 2019 and 2016, while other guides say those versions do not support it. The reliable test is to type =XLOOKUP( in your own copy of Excel. If the people you share workbooks with are on older versions, stick with VLOOKUP or INDEX/MATCH so the formulas work for everyone.
Quick checklist
- Always end with
FALSEunless you want approximate matching on a sorted column. - Lock the table range with
$before copying the formula. - Make sure the lookup value sits in the first column of the range.
- Check data types and stray spaces before blaming the formula.
- Recount
col_index_numafter inserting or deleting columns. - Consider XLOOKUP if everyone on your team has a version that supports it.
Free apps worth trying
SponsoredSponsored links. Installing through them can earn us a commission, at no cost to you. Apps are free to download; some offer optional in-app purchases.
Frequently asked questions
Why does my VLOOKUP return the wrong value instead of an error? +
The most common cause is leaving out the fourth argument. When range_lookup is omitted, Excel uses TRUE (approximate match), which can return a nearby row instead of the one you wanted. Add FALSE as the last argument to force an exact match.
Can VLOOKUP look to the left? +
No. VLOOKUP always searches the first column of the table range and returns a value from a column to its right. To return a value from the left, use XLOOKUP or an INDEX/MATCH combination.
Should I switch from VLOOKUP to XLOOKUP? +
If everyone who opens your workbook has a version of Excel that supports XLOOKUP, it is usually the easier and sturdier choice. If you share files with people on older versions, VLOOKUP is still the safer option because XLOOKUP formulas will not work for them.
Is VLOOKUP being removed from Excel? +
Nothing in Microsoft's documentation indicates that. VLOOKUP is still a documented, supported function as of November 2026; XLOOKUP is simply offered as a more flexible alternative.
Sources
- VLOOKUP function - Microsoft Support (support.microsoft.com)
- XLOOKUP function - Microsoft Support (support.microsoft.com)
- How to correct a #N/A error - Microsoft Support (support.microsoft.com)
- XLOOKUP: Everything You Need to Know to Upgrade from VLOOKUP - Excel Campus (excelcampus.com)
- Excel VLOOKUP errors: #N/A, #VALUE, #NAME - Ablebits (ablebits.com)
- VLOOKUP with Wildcards in Excel - Spreadsheeto (spreadsheeto.com)