How to Use VLOOKUP in Excel, with Worked Examples

By Mohamed Updated 2 November 2026 6 min read

VLOOKUP: Look up a value in a table

VLOOKUP looks for a value in the first column of a table and returns the value from the same row, in a column you choose. The classic use: you type a product code and Excel shows its price.

The formula =VLOOKUP(F2,A2:D7,3,FALSE) looks for the contents of F2 in column A and returns the value from the 3rd column of the range A2:D7. The last argument, FALSE, asks for an exact match, which is what you want in most cases.

VLOOKUP syntax

=VLOOKUP(lookup_value,table_array,col_index_num,[range_lookup])
  • lookup_value: what you are looking for (a code, a name, an ID). Usually a cell such as F2.
  • table_array: the range that holds the data. The lookup value must be in its first column.
  • col_index_num: the number of the column to return, counted from the first column of the range (1 = the first column of the range, not necessarily column A).
  • range_lookup: FALSE (or 0) for an exact match, TRUE (or 1) for an approximate match. If you leave it out, Excel uses TRUE.

Example: find a product's price from its code

Here is a product list in A1:D7 and a cell F2 where you type the code you want.

ABCDEFG
1CodeProductPriceStockCodePrice
2P-101Keyboard£24.9945P-103£139.00
3P-102Mouse£12.50120
4P-10324-inch monitor£139.0012
5P-104Webcam£42.000
6P-105Headset£34.9933
7P-106USB hub£19.0058

In G2:

=VLOOKUP(F2,A2:D7,3,FALSE)

Excel scans column A from top to bottom, finds P-103 in row 4 and returns the 3rd column of the range (Price): £139.00. Change only the column number to get another detail from the same row:

  • =VLOOKUP(F2,A2:D7,2,FALSE) returns 24-inch monitor;
  • =VLOOKUP(F2,A2:D7,4,FALSE) returns 12 (the stock).

Copy the formula down without shifting the range

If you have several codes in F2:F4 and fill the formula down, the range A2:D7 moves too (A3:D8, A4:D9…) and soon misses rows. Lock it with $ signs:

=VLOOKUP(F2,$A$2:$D$7,3,FALSE)

In the formula bar, select A2:D7 and press F4: Excel adds the $ signs for you. F2 stays relative, so it becomes F3, F4… on each row.

FG
1CodePrice
2P-105£34.99
3P-101£24.99
4P-110#N/A

P-110 is not in the list, so VLOOKUP returns #N/A. The errors section below shows how to display a message instead.

Exact match (FALSE) or approximate match (TRUE)

With FALSE, VLOOKUP only returns a result if the value exists as it is in the first column. The order of the rows does not matter.

With TRUE, VLOOKUP returns the row of the largest value that is less than or equal to the lookup value. This is what you need for a banded rate table, on one condition: the first column must be sorted in ascending order.

Example: a commission rate that depends on sales. The rate table is in E2:F5.

ABCDEF
1RepSalesRateSales fromRate
2Emily£18,4003%£00%
3James£52,0008%£10,0003%
4Priya£25,0005%£25,0005%
5Tom£9,8000%£50,0008%

In C2, then filled down to C5:

=VLOOKUP(B2,$E$2:$F$5,2,TRUE)

For Emily (£18,400), the largest threshold that is not above 18,400 is 10,000, so her rate is 3%. Priya hits 25,000 exactly and gets 5%. Tom, below 10,000, falls into the first band: 0%.

VLOOKUP from another sheet

The reference table often sits on another sheet. Put the sheet name and an exclamation mark in front of the range. If the product list is on a sheet called Prices:

=VLOOKUP(A2,Prices!$A$2:$D$7,3,FALSE)

The easiest way is to type =VLOOKUP(A2,, click the Prices tab and select the range with the mouse: Excel writes the reference for you. If the sheet name contains spaces, Excel wraps it in single quotes: 'Prices 2026'!$A$2:$D$7.

VLOOKUP errors and how to fix them

#N/A: the value is not found

This is the most common error. Likely causes, from most to least frequent:

  1. The value really is missing from the first column (like P-110 above).
  2. Extra spaces: "P-103" and "P-103 " with a trailing space are different to Excel. Clean the lookup value with =VLOOKUP(TRIM(F2),$A$2:$D$7,3,FALSE), or clean the table column itself. For other stray characters, see removing special characters.
  3. Number on one side, text on the other: the code 1025 typed as a number does not match the text "1025" exported from another system. A small green triangle in the corner of the cells often flags numbers stored as text. Convert the column to numbers, or force the conversion in the formula with F2*1 when the lookup value is text and the table holds numbers.
  4. The lookup value is not in the first column of the range: with B2:D7, VLOOKUP searches column B (Product), not the codes.
  5. The range moved when the formula was copied down, because the $ signs were missing.

When a missing value is expected (a code not yet in the list), replace the error with a message:

=IFERROR(VLOOKUP(F2,$A$2:$D$7,3,FALSE),"Unknown code")

Only add IFERROR once the formula works: it also hides errors caused by a wrong range.

#REF!: column number too high

The range A2:D7 has 4 columns. =VLOOKUP(F2,A2:D7,5,FALSE) returns #REF! because there is no 5th column in the range. Widen the range or fix the number.

#VALUE!: column number below 1

A column number of 0 or less returns #VALUE!. VLOOKUP cannot return a column to the left of the first column of the range.

#NAME?: misspelt function name

Excel does not recognise the function, for example =VLOKUP(…), or =RECHERCHEV(…) copied from a French tutorial. As you type =VLO, Excel suggests the function: press Tab to accept it.

Partial match with wildcards

With an exact match, the lookup value can contain * (any sequence of characters) or ? (a single character). On the product list, this formula looks in column B for the first product that starts with "Web" and returns its price:

=VLOOKUP("Web*",B2:C7,2,FALSE)

Result: £42.00 (Webcam). VLOOKUP is not case-sensitive: "webcam" and "Webcam" are the same to it.

Limits of VLOOKUP

It only looks to the right

The lookup column has to be the first column of the range. To find the code (column A) from the product name (column B), VLOOKUP cannot help. Use XLOOKUP (below) or rearrange the columns.

The column number is hard-coded

If you insert a column between Product and Price, a formula with 3 now returns the new column instead of the price. To make the number follow the header, calculate it with MATCH and include the header row in the range:

=VLOOKUP(F2,$A$1:$D$7,MATCH("Price",$A$1:$D$1,0),FALSE)

MATCH("Price",$A$1:$D$1,0) returns 3 while "Price" is the 3rd header, and adjusts if the columns move.

It only returns the first match

If a code appears twice, VLOOKUP stops at the first row it finds and ignores the other one, with no warning. Check your lookup column and, if needed, remove duplicates or count them with COUNTIF: =COUNTIF($A$2:$A$7,F2) should return 1.

XLOOKUP, the successor to VLOOKUP

In Excel 2021, Excel 2024, Microsoft 365 and Excel for the web, XLOOKUP removes these limits. It takes the lookup column and the result column separately:

=XLOOKUP(F2,A2:A7,C2:C7)

Result: £139.00 for P-103. The match is exact by default, inserting a column breaks nothing, and it can look to the left:

=XLOOKUP("Webcam",B2:B7,A2:A7)

Result: P-104. A 4th argument replaces IFERROR: =XLOOKUP(F2,A2:A7,C2:C7,"Unknown code").

VLOOKUP is still the safer choice if your files are opened in Excel 2019 or earlier, where XLOOKUP shows #NAME?.

Mohamed · Writer, Excel Zone

Mohamed writes the guides on looking up and analysing data: VLOOKUP, COUNTIFS, PivotTables, dashboards, as well as the learning path for beginners.