Free VLOOKUP practice

VLOOKUP practice exercises

VLOOKUP finds a value in the first column of a table and returns the value from a column to its right. 5 reps, from easy to hard, each checked in a real spreadsheet engine. 2 free, 3 with Pro.

=VLOOKUP(lookup_value, table_array, col_index_num, FALSE)
Skill: VLOOKUP Change skill (45)

VLOOKUP guide

How to use VLOOKUP in Excel

VLOOKUP finds a value in the first column of a table and returns the value from another column in the same row. It is one of the most common questions in Excel job tests, so it pays to get it exactly right, especially the last argument.

The V stands for vertical: VLOOKUP searches down the first column of the table. It can only return columns to the right of that column. To look up to the left, use XLOOKUP or INDEX with MATCH.

Syntax

=VLOOKUP(lookup_value, table_array, col_index_num, FALSE)
ArgumentWhat it is
lookup_valueThe value to find, such as a product code. Usually a cell reference, like E2.
table_arrayThe table to search. The lookup value must be in its first column. Lock it with $ (press F4) before you fill the formula down.
col_index_numWhich column of the table to return, counting from 1 at the table's first column, not from column A of the sheet.
range_lookupFALSE for an exact match. Leave it out and VLOOKUP does an approximate match, which can return the wrong row without any error.

Examples

Example 1 Find a price by product code. The code to look up is in E2. The price is the 3rd column of the table A2:C5.
F2fx=VLOOKUP(E2,A2:C5,3,FALSE)
ABCDEF
1CodeProductPriceCodePrice
2P-101Desk249P-10339
3P-102Chair129
4P-103Lamp39
5P-104Shelf89

=VLOOKUP(E2,A2:C5,3,FALSE) returns 39.

Example 2 Put a score into a grade band. This is the one case where approximate match is right: the first column holds the lower bound of each band, sorted from smallest to largest. VLOOKUP finds the largest bound that is not above the score.
E2fx=VLOOKUP(D2,A2:B6,2,TRUE)
ABCDE
1FromGradeScoreGrade
20F73B
350D
460C
570B
680A

=VLOOKUP(D2,A2:B6,2,TRUE) returns B.

Example 3 Show a message when the code isn't there. Wrap VLOOKUP in IFERROR to replace #N/A with something readable.
F2fx=IFERROR(VLOOKUP(E2,A2:C5,3,FALSE),"Not found")
ABCDEF
1CodeProductPriceCodePrice
2P-101Desk249P-999Not found
3P-102Chair129
4P-103Lamp39
5P-104Shelf89

=IFERROR(VLOOKUP(E2,A2:C5,3,FALSE),"Not found") returns Not found.

Common mistakes

Leaving out FALSE

Without FALSE, VLOOKUP does an approximate match. For a code that doesn't exist it quietly returns a nearby row's value instead of an error. Here P-105 isn't in the table, but you get Shelf's price.

Wrong=VLOOKUP("P-105",A2:C5,3) → 89

Right=VLOOKUP("P-105",A2:C5,3,FALSE) → #N/A

The lookup value isn't in the first column

VLOOKUP only searches the first column of table_array. To find a product by name, start the table at the name column, and count the columns from there.

Wrong=VLOOKUP("Lamp",A2:C5,3,FALSE) → #N/A

Right=VLOOKUP("Lamp",B2:C5,2,FALSE) → 39

A column number past the end of the table

col_index_num counts columns inside table_array. The table A2:C5 has 3 columns, so 4 is out of range.

Wrong=VLOOKUP("P-103",A2:C5,4,FALSE) → #REF!

Right=VLOOKUP("P-103",A2:C5,3,FALSE) → 39

VLOOKUP questions

What does FALSE mean in VLOOKUP?

It asks for an exact match. Without it VLOOKUP does an approximate match, which only makes sense for sorted bands such as grade or tax tables. For codes, names and IDs, always end with FALSE (or 0).

Why does my VLOOKUP return #N/A?

The value wasn't found in the first column of the table. Common causes: the value really is missing, there are extra spaces (use TRIM), a number is stored as text, or the table starts at the wrong column.

Can VLOOKUP look to the left?

No. It only returns columns to the right of the first column of the table. Use XLOOKUP or INDEX with MATCH to return a column on the left.

Should I learn VLOOKUP or XLOOKUP?

Both. XLOOKUP is easier and safer, but only works in Excel 365, 2021 and later. VLOOKUP works in every version and still comes up in most Excel tests.

Related functions

Reading is the warm-up

The reps are what make it stick. Try VLOOKUP in the practice sheet above.

Practise VLOOKUP ↑