Skip to content

VLOOKUP

Searches the first column of a table for a value and returns the item from another column of the same row. It is in every version of Excel.

Syntax

=VLOOKUP(, , , )

Lookup and reference

Every version of Excel, including Microsoft 365, Excel 2024, 2021, 2019, 2016 and earlier, Excel for the web and the mobile apps.

Try it

Edit the formula in B9 or change the inputs. The sheet recalculates as you type.

B9
A
B
C
D
E
1
Employee ID
Name
Department
Salary
2
E-101
Priya Nair
Finance
62,000
3
E-102
Tom Hale
Logistics
48,500
4
E-103
Sara Lind
Finance
71,200
5
E-104
Marcus Doyle
IT
66,800
6
E-105
Ana Costa
HR
54,300
7
8
Find ID
Salary
9
E-104
66,800

B9 =VLOOKUP(A9,A2:D6,4,FALSE) returns 66,800

How VLOOKUP works

VLOOKUP looks down the first column of a table for a value and returns the item from another column of the same row. It is the function most people learn first, and it is in every version of Excel, so you will meet it in almost any workbook you inherit.

The four arguments

  • lookup_value is what you are searching for. Point at a cell rather than typing the value.
  • table_array is the block that holds both the search column and the column you want back. VLOOKUP always searches the leftmost column of this block.
  • col_index_num is the position of the column to return, counted from the left of table_array. A number larger than the table is wide returns #REF!, and a number below 1 returns #VALUE!.
  • range_lookup chooses the match type. FALSE (or 0) is an exact match. TRUE, or leaving the argument out, is an approximate match.

The default is approximate

Leaving out the fourth argument means approximate match, and it is the most common VLOOKUP mistake. An approximate match assumes the first column is sorted ascending and returns the last row whose key is less than or equal to the lookup value. For sorted bands, such as score grades or commission tiers, that is what you want. On an ID list it quietly returns a wrong row with no error. For IDs, names and codes, always type FALSE.

An exact match returns the first match from the top, ignores upper and lower case, and accepts the wildcards * and ? when you look up text.

VLOOKUP, INDEX/MATCH and XLOOKUP

VLOOKUP is short, everyone can read it, and it works in every version. Its weaknesses are real, though. It can't return a column to the left of the search column. The column number is a hard-coded count, so inserting or deleting a column inside the table can change the result without any warning. And the approximate default is a trap.

INDEX with MATCH removes all three problems and also works in every version, at the cost of a longer formula. XLOOKUP does the same job in one function, with a not-found message built in, but it needs Excel 2021 or Microsoft 365.

A practical rule: if the file only opens in current Excel, use XLOOKUP. If it must open in Excel 2019 or earlier, use INDEX/MATCH, or VLOOKUP with FALSE for simple left-to-right jobs. If you keep VLOOKUP, make the column number follow the header with MATCH, as in the examples below.

Handling a missing value

An exact VLOOKUP returns #N/A when the value isn't in the first column. Wrap it in IFNA to show your own message: =IFNA(VLOOKUP(A9,A2:D7,4,FALSE),"Not listed"). Prefer IFNA to IFERROR here, because IFERROR also hides real mistakes such as a column number that is too large.

Arguments

lookup_value
What to look for, such as A9. Point at a cell rather than typing the value. A lookup value longer than 255 characters returns #VALUE!.
table_array
The block that holds the search column and the column you want back, such as A2:D7. VLOOKUP always searches the leftmost column of this block.
col_index_num
The position of the column to return, counted from the left of table_array: 1 is the search column, 2 the next one. A number larger than the table is wide returns #REF!. A number below 1 returns #VALUE!.
range_lookupoptional
FALSE (or 0) finds an exact match and returns #N/A if there is none. TRUE (or leaving it out) finds an approximate match: the largest value that is less than or equal to lookup_value, which only works if the first column is sorted ascending.

Examples

Each example is a live sheet. Change the inputs or the formula and watch the result.

Example 1

Exact match: find a salary by employee ID

B9 =VLOOKUP(A9,A2:D6,4,FALSE)

Result: 66,800

VLOOKUP finds E-104 in the first column of A2:D6 and returns the value from the fourth column of that row. FALSE asks for an exact match.

B9
A
B
C
D
E
1
Employee ID
Name
Department
Salary
2
E-101
Priya Nair
Finance
62,000
3
E-102
Tom Hale
Logistics
48,500
4
E-103
Sara Lind
Finance
71,200
5
E-104
Marcus Doyle
IT
66,800
6
E-105
Ana Costa
HR
54,300
7
8
Find ID
Salary
9
E-104
66,800

B9 =VLOOKUP(A9,A2:D6,4,FALSE) returns 66,800

Example 2

Show a message when the ID is missing

B9 =IFNA(VLOOKUP(A9,A2:D6,4,FALSE),"Not listed")

Result: Not listed

E-250 isn't in the list, so VLOOKUP returns #N/A and IFNA replaces it with the message. Other errors, such as #REF!, would still show.

B9
A
B
C
D
E
1
Employee ID
Name
Department
Salary
2
E-101
Priya Nair
Finance
62,000
3
E-102
Tom Hale
Logistics
48,500
4
E-103
Sara Lind
Finance
71,200
5
E-104
Marcus Doyle
IT
66,800
6
E-105
Ana Costa
HR
54,300
7
8
Find ID
Salary
9
E-250
Not listed

B9 =IFNA(VLOOKUP(A9,A2:D6,4,FALSE),"Not listed") returns Not listed

Example 3

Approximate match: turn a score into a grade band

B9 =VLOOKUP(A9,A2:B6,2,TRUE)

Result: B

72 isn't in the first column, so the approximate match drops to the largest value that is not above it: 70, which is a B. The first column must be sorted ascending.

B9
A
B
C
1
Score from
Grade
2
0
F
3
50
D
4
60
C
5
70
B
6
85
A
7
8
Score
Grade
9
72
B

B9 =VLOOKUP(A9,A2:B6,2,TRUE) returns B

Example 4

Let the header choose the column with MATCH

C8 =VLOOKUP(A8,A1:E5,MATCH(B8,A1:E1,0),FALSE)

Result: 44,600

MATCH finds Q3 in the header row and returns 4, so VLOOKUP returns the fourth column. If a column is inserted into the table, MATCH still finds the right header.

C8
A
B
C
D
E
1
Region
Q1
Q2
Q3
Q4
2
North
48,200
51,400
49,800
57,900
3
South
31,750
33,100
35,200
36,800
4
East
42,900
41,300
44,600
47,100
5
West
37,400
39,800
38,900
43,200
6
7
Region
Quarter
Revenue
8
East
Q3
44,600
9
10

C8 =VLOOKUP(A8,A1:E5,MATCH(B8,A1:E1,0),FALSE) returns 44,600

Your turn.

Solve it in the sheet. Every answer is checked, with hints if you need them.

Task 1 of 3

In B9, return the bin for the part code in A9. The list isn't sorted, so ask for an exact match.

Answer in B9.

B9
A
B
C
D
E
F
1
Part
Description
Bin
Unit cost
Score from
Band
2
P-402
Hex bolt M8
B-14
0.18
0
Fail
3
P-118
Washer 8 mm
A-03
0.04
50
Pass
4
P-275
Brake pad set
D-22
18.50
65
Merit
5
P-330
Oil filter
C-09
6.75
80
Distinction
6
P-091
Gasket 40 mm
A-11
1.90
7
P-206
Fan belt
D-05
12.40
8
9
P-330
10
Score
Band
11
72
12
13

Common mistakes

  • Leaving out the fourth argument runs an approximate match. On unsorted IDs or names it can return the wrong row with no error. Type FALSE for any exact lookup.
  • The column number is a count, not a reference. Inserting a column inside table_array shifts the count and can return the wrong column silently. Use MATCH on the header to find the number, or switch to XLOOKUP or INDEX/MATCH.
  • #N/A on an exact match means the value isn't in the first column of table_array. Check for stray spaces (TRIM removes them), a number stored as text, and whether your table starts on the right column.
  • The table range slides when you fill the formula down. Lock it with dollar signs, such as $A$2:$D$7, and keep lookup_value relative.
  • VLOOKUP can't return a column to the left of the search column. Use INDEX/MATCH or XLOOKUP instead of rearranging the table.

Questions people ask

Why does VLOOKUP return #N/A?

With an exact match it means the lookup value isn't in the first column of table_array. The usual causes are a typo, a trailing space, a number stored as text, or a table range that starts one column too far right. Wrap the formula in IFNA to show your own message.

What does the last argument of VLOOKUP do?

`FALSE` (or 0) means exact match. `TRUE`, or leaving it out, means approximate match on a sorted first column. Use `FALSE` for IDs and names and `TRUE` only for bands such as grades or tax tiers.

Can VLOOKUP look to the left?

No. It returns columns to the right of the search column only. Use INDEX with MATCH, or XLOOKUP in Excel 2021 and Microsoft 365.

Is VLOOKUP case-sensitive?

No. Looking up "east" finds "East". For a case-sensitive lookup, use INDEX with MATCH and EXACT, or XLOOKUP with EXACT.

Should I still use VLOOKUP now that XLOOKUP exists?

For new work in current Excel, XLOOKUP is safer: exact by default, no column counting, and it can look left. Keep VLOOKUP when the file must open in Excel 2019 or earlier, or when you are maintaining a workbook that already uses it.

Learn VLOOKUP in a real sheet.

VLOOKUP is taught in Lookups and references, lesson 2: VLOOKUP with exact match. Each lesson is a short, graded exercise like the one above.