toolrota

Excel VLOOKUP explained: step-by-step examples and the mistakes to avoid

VLOOKUP finds a value in a table and returns something from the same row. Here is the syntax, the exact-match setting and the real reasons behind #N/A.

Serkan Akyürek·Updated ·4 min read
Excel VLOOKUP explained: step-by-step examples and the mistakes to avoid – Excel

VLOOKUP searches the first column of a table for the value you give it and returns a value from another column in the same row. It is the classic tool for pulling a price by product code or a grade by student number.

Syntax

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
  • lookup_value: what you are looking for, such as the product code in A2.
  • table_array: the table to search. The lookup value must be in its first column.
  • col_index_num: which column of the table to return (the first column is 1).
  • range_lookup: enter FALSE (or 0) for an exact match.

Example

Say the price list is in E2:G100, with product codes in the first column and prices in the third:

=VLOOKUP(A2,$E$2:$G$100,3,FALSE)

Lock the table range with $ so it does not shift when you fill the formula down.

Do not skip the last argument

If you leave the fourth argument out, Excel uses approximate match and returns wrong results on unsorted lists. For codes, names and emails always type FALSE. TRUE only makes sense for sorted range tables such as tax brackets or grade bands.

Common causes of #N/A

  1. The value really is not in the list. Check for spelling differences.
  2. Extra spaces: "A101 " is not "A101". Clean with =TRIM(A2).
  3. Text versus number: one side is a number stored as text, the other a real number. Convert if you see the green triangle.
  4. The lookup value is not in the first column: VLOOKUP only looks to the right.

=IFERROR(VLOOKUP(...),"Not found") hides the error, but fix the cause first.

Inserting columns breaks the formula

The column index is a fixed number. If you insert a column in the table, the wrong column is returned. Use MATCH instead of a fixed number, or switch to XLOOKUP.

VLOOKUP or XLOOKUP?

FeatureVLOOKUPXLOOKUP
Look to the leftNoYes
Default matchApproximateExact
Breaks when columns are insertedYesNo
Older Excel versionsYesOnly 2021 and 365

With Microsoft 365, XLOOKUP is safer for new work; see our XLOOKUP guide. If the file will be opened by people on older versions, VLOOKUP is still the most compatible choice.

Step-by-step example: pulling a product price and VAT from a price list

Suppose the price list is on a "Prices" sheet: column A product code, B product name, C unit price, D VAT rate. On the sales sheet you want details to arrive when you type the code:

CellFormulaResult
B2 (product name)=IFERROR(VLOOKUP(A2,Prices!$A$2:$D$500,2,FALSE),"Code not found")Product name
C2 (price)=IFERROR(VLOOKUP(A2,Prices!$A$2:$D$500,3,FALSE),0)Unit price
D2 (VAT rate)=IFERROR(VLOOKUP(A2,Prices!$A$2:$D$500,4,FALSE),0)VAT rate
E2 (amount)=C2*F2*(1+D2)Line amount (the quantity is in column F)

Points to watch: lock the lookup range with `$`, make the last argument FALSE (exact match) and make sure the code is in the first column. For an invoice template see our invoice template guide.

Common errors and quick fixes

SymptomCauseFix
#N/AValue not foundSpelling, spaces (TRIM), text/number difference
Wrong valueLast argument TRUE/blankWrite FALSE (0)
Breaks when dragged downRange not lockedUse $A$2:$D$500
Breaks when a column is addedFixed column numberDynamic column with IFERROR + MATCH, or XLOOKUP
Can't return the column on the leftVLOOKUP looks only rightINDEX-MATCH or XLOOKUP
SlownessA huge rangeUse a table/name, cut unneeded rows

Better options on big lists

VLOOKUP finds one match and can't return the column on the left. For more flexible formulas see our INDEX-MATCH and XLOOKUP guides. A table structure (Ctrl + T) also makes references readable (see our Excel tables guide).

Frequently asked questions

Can it return several results? No; it returns only the first match. To list all use FILTER (Microsoft 365).

How do I look up by ranges (like a commission band)? Use an approximate match by making the last argument TRUE and sorting the first column from small to large.

Looking up from two sheets? You can use nested IFERROR that searches one and, if not found, looks at the other; XLOOKUP does this more cleanly.

How do I look up a table in another file? With a full-path reference while the file is open; keep the data in the same file where possible.

Can I search within text? Partial matching is possible with wildcards ("*"&A2&"*"); but watch for wrong matches.

Share
Published:
Author
Serkan Akyürek

Serkan Akyürek is the founder and author of toolrota; he writes step-by-step guides on Excel, AI, the cloud, personal finance and digital security.