Excel function

VLOOKUPfunction

Finds a value in the first column of a table and returns a value from another column in the same row.

All versions
=VLOOKUP("P004", A2:D9, 3, FALSE)
A
B
C
D
1
2
3
4
5
6
7
8
9

Click a cell to change lookup_value. Drag the corner dots to change table_array. Click the numbers on the top to change col_index_num. Try breaking it on purpose to see the errors.

Result

6900

lookup_value

The value to find in the first column of table_array.

table_array
A2:D9Drag the corner dots on the table

The table to search. VLOOKUP always searches the first column of this range only.

col_index_num
3table_array has 4 columns

Which column of table_array to return. The first column is 1.

range_lookup

FALSE finds an exact match only. TRUE finds the closest value that is less than or equal to lookup_value.

What is the VLOOKUP function?

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

VLOOKUP looks for a value in the first column of a table and returns the value from another column in the same row. The V stands for vertical: it searches down the first column from top to bottom.

Use it whenever you need "the value that goes with this one": a price for a product code, a name for an employee ID, a grade for a score.

The one rule to remember is that VLOOKUP only ever searches the first column of table_array. Drag the top-left handle of the range in the sheet above to move its first column, and watch the same lookup value give a different result.

Arguments

lookup_value
The value to find in the first column of table_array. Type it directly, like "P004", or point to a cell such as F2. Text matching is not case-sensitive.
table_array
The table to search. The column that contains lookup_value must be the first column of this range, and the column you want to return must also be inside it.
col_index_num
The position of the column to return, counted inside table_array. It is not the sheet column letter: if table_array starts at column B, then B is 1 and C is 2.
range_lookup
FALSE returns only an exact match. TRUE returns the largest value that is less than or equal to lookup_value, and needs the first column sorted in ascending order. If you leave it out, VLOOKUP uses TRUE, so type FALSE whenever you need an exact match.

VLOOKUP examples

  1. Example 1. Find a price by product code

    =VLOOKUP("P004", A2:D9, 3, FALSE)

    Finds P004 in column A and returns the 3rd column of the range (Price). The result is 6900. This is the formula the sheet above starts with.

  2. Example 2. Use a cell as the lookup value

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

    With P006 in F2, the result is Noodles. Pointing to a cell lets you change the code without editing the formula. Lock table_array with $ so it doesn't shift when you copy the formula down.

  3. Example 3. Assign grades with approximate match

    =VLOOKUP(85, A2:B6, 2, TRUE)

    List the starting score of each band in ascending order. There is no 85, so VLOOKUP takes 80, the largest value below 85, and returns B. Use the same pattern for tiered rates, commissions or shipping fees.

    Score (from)Grade
    0F
    60D
    70C
    80B
    90A

Common mistakes

FAQ

Why does VLOOKUP return #N/A when the value is clearly there?
Usually the value is not in the first column of table_array, there are hidden spaces, or one side is a number and the other is text.
Can VLOOKUP return a value to the left?
No. It only returns columns to the right of the first column. Use XLOOKUP, or INDEX with MATCH.
Should I use TRUE or FALSE?
Use FALSE for codes, names and IDs. Use TRUE only for bands like score ranges, with the first column sorted in ascending order.