Numbers Exercises

VLOOKUP in Numbers: Look Up Values in a Table

Last updated:

Short answer: VLOOKUP searches for a value in the first column of a range and returns the value from another column in the same row: VLOOKUP(search value, range, column number, exact). With INDEX and MATCH you can search in any column.

The examples use this table.

Table 1
ABC
1ProductPriceQty
2Apple410
3Pear65
4Kiwi122
5Grape83

VLOOKUP step by step

You search for “Kiwi” in the first column of A2:C5 and want the value from column 2 of the range, which is the price. The 0 at the end means: exact match only.

=VLOOKUP("Kiwi",A2:C5,2,0)
Result: 12

The column number

The column number is the position inside the range, counting from the first column of that range. With 3 you get the quantity here.

=VLOOKUP("Kiwi",A2:C5,3,0)
Result: 2

When the value does not exist

If the search value is not in the table, VLOOKUP returns an error. With IFERROR you show your own text instead.

=IFERROR(VLOOKUP("Mango",A2:C5,2,0),"Not found")
Result: Not found

INDEX and MATCH as an alternative

MATCH returns the position of a value in a list and INDEX fetches the value at a position. Together they also work when the lookup column is not the first one.

=INDEX(B2:B5,MATCH("Pear",A2:A5,0))
Result: 6

Frequently asked questions

Why does VLOOKUP return an error?

Usually the search value is not in the first column of the range, or it is spelled differently. Use IFERROR to show your own text.

What is the column number in VLOOKUP?

The position of the column within the range, counted from the first column of the range.

VLOOKUP or INDEX and MATCH?

VLOOKUP is shorter. INDEX and MATCH is more flexible because the lookup column does not have to be the first one.

Functions in this article

Practise it yourself

Type the formula yourself in a real exercise and see right away if your answer is correct. The first exercises are free.

Start practising