LocalExcelTool
Get started

Excel VLOOKUP function

VLOOKUP finds a value in the leftmost column of a range and returns something from the same row. It is the most common way to pull data across sheets, with one built-in limit: it only looks right. If you need to look left, or return several columns at once, use XLOOKUP or INDEX + MATCH.

Lookup & reference · Available in: Excel 97 and every desktop version since

Syntax

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

What it returns The value in column N of the matched row; #N/A when an exact match is not found.

Arguments
lookup_valuerequiredThe value to find — a number, text, a cell reference or the result of another formula.
table_arrayrequiredThe range to search. The key must be its first column, and the return value must sit to the right of the key.
col_index_numrequiredWhich column of the range to return, counting from 1 — the position inside the range, not the worksheet column letter.
range_lookupoptionalFALSE/0 for an exact match; TRUE/1 or omitted for an approximate match, which requires the first column to be sorted ascending.

Examples

Amount for an order number (exact match)

OrderCustomerAmount
1001Acme Ltd240
1002Globex180
1003Initech96
= VLOOKUP(1002,$A$2:$C$4,3,FALSE)

→ 180

1002 is found in A2:A4, at the second row of the range; the third argument says return column 3, which is C3 = 180. FALSE means exact — a missing key returns #N/A rather than "the closest value".

Tax rate by income band (approximate match)

Min incomeRate
00.10
400000.22
900000.24
= VLOOKUP(52000,$A$2:$B$4,2,TRUE)

→ 0.22

TRUE means approximate: return the largest row that does not exceed the lookup value. 52000 falls between 40000 and 90000, so the 40000 row matches and the rate is 0.22. With TRUE the first column must be sorted ascending; out of order, the wrong row is picked with no warning.

Common mistakes

  • 1.The key is not in the first column of the range. VLOOKUP only searches table_array's first column, so a key in column B never matches — move the key leftmost, or switch to XLOOKUP.
  • 2.Reading the third argument as a worksheet column number. If the range starts at B and you want C, the answer is 2, not 3.
  • 3.Not locking the range to $A$2:$C$4. Drag the formula down and the range slides with it; the last rows return wrong values or #N/A and nothing complains.
  • 4.The key stored as text. A left-aligned "1002" with a green triangle is not equal to the number 1002, so the exact match returns #N/A.

How to use it

  1. 1.Click the cell where the result should appear.
  2. 2.Type = then the function name, and press Tab to accept it.
  3. 3.Enter each argument separated by commas; ranges can be dragged with the mouse.
  4. 4.Press Enter. Drag the fill handle down if the same formula applies to more rows.

Frequently asked questions

What is the syntax of VLOOKUP?

VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup]). What it returns: The value in column N of the matched row; #N/A when an exact match is not found.

Which Excel versions support VLOOKUP?

Excel 97 and every desktop version since. It is available in every desktop version unless the note above says otherwise.

Why does VLOOKUP return an error instead of a value?

The key is not in the first column of the range. VLOOKUP only searches table_array's first column, so a key in column B never matches — move the key leftmost, or switch to XLOOKUP.

Related functions

More in this group

Need to get the data in first?

← All Excel formulas