Excel VLOOKUP function — find a price by code

VLOOKUP searches the first column of a table for a value and returns the value from the column you choose in the same row — for example a product's price by its code.

In other languages: DÜŞEYARA (Türkçe), ВПР (Русский)

Syntax

VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

Arguments

lookup_value
The value to find (e.g. the code in E2).
table_array
The table to search; the search column must be the first one. Lock it with $.
col_index_num
The number of the column to return (inside the table: 1, 2, 3…).
range_lookup
FALSE (or 0) for an exact match. Almost always use FALSE.

Example

Find the price of the product whose code (P-102) is typed in E2.

ABC
1CodeProductPrice
2P-101Laptop1200
3P-102Monitor350
4P-103Printer280

Type the formula in F2

The formula in your Excel

  • English Excel=VLOOKUP(E2,$A$2:$C$4,3,FALSE)
  • Türkçe Excel=DÜŞEYARA(E2;$A$2:$C$4;3;YANLIŞ)
  • Русский Excel=ВПР(E2;$A$2:$C$4;3;ЛОЖЬ)

For P-102 the result is 350.

✨ Have the AI explain this formula

Useful tips

  • Lock the table as $A$2:$C$4 so it does not shift when you fill the formula down.
  • If the search column is not the first one, use XLOOKUP or INDEX + MATCH.

Common errors

  • #N/A — not found: the code may contain extra spaces (clean with TRIM) or a number may be stored as text.
  • #REF! — the column number is larger than the number of columns in the table.