No history yet

Introduction to Excel Lookup Functions

Looking Up Data with VLOOKUP

Imagine you're at a restaurant with a huge menu. You know you want the 'Classic Burger', but you need to find its price. You scan down the list of items until you find 'Classic Burger', then slide your finger across the row to the 'Price' column. That's exactly what VLOOKUP does in Excel.

The term VLOOKUP stands for Vertical Lookup.

VLOOKUP scans vertically down the first column of a table to find a specific value you're looking for. Once it finds a match, it moves horizontally to the right to retrieve a value from a column you specify.

Let's look at its structure:

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

Here’s what each part means:

  • lookup_value: What you want to search for. (e.g., "Classic Burger")
  • table_array: The range of cells that contains the data.
  • col_index_num: The column number in the table from which to retrieve a value. The first column is 1, the second is 2, and so on.
  • [range_lookup]: This is optional. Use FALSE for an exact match and TRUE for an approximate match. You'll almost always want an exact match, so you'll typically use FALSE.

Consider this simple product inventory table:

Product IDProduct NamePriceIn Stock
101Espresso$3.5045
102Latte$4.2532
103Cappuccino$4.2528
104Drip Coffee$2.7550

If we want to find the price of a Latte, we would use this formula:

=VLOOKUP("Latte", A2:D5, 3, FALSE)

Excel looks for "Latte" in the first column of our table (A2:D5), finds it, then goes to the 3rd column to retrieve the price, which is $4.25.

VLOOKUP is handy, but it has a major limitation: it can only look to the right. It can't find "Latte" in column B and then look left to get its Product ID from column A. For that, we need a more flexible approach.

Pinpoint Data with INDEX and MATCH

Instead of relying on a single function, we can combine two of them, INDEX and MATCH, to create a lookup that's more powerful and flexible than VLOOKUP. Let's break them down individually first.

INDEX

verb

Returns a value or reference of the cell at the intersection of a particular row and column, in a given range.

Think of INDEX like a game of Battleship. You give it coordinates (a row and column number), and it tells you what's in that cell.

Its syntax is: =INDEX(array, row_num, [column_num])

Using our table, =INDEX(A2:D5, 2, 4) would return 32, because that's the value in the 2nd row and 4th column of our data range (the stock level for a Latte).

MATCH

verb

Searches for a specified item in a range of cells, and then returns the relative position of that item in the range.

MATCH tells you the position of a value within a list, not the value itself. It answers the question, "In which row (or column) can I find this item?"

Its syntax is: =MATCH(lookup_value, lookup_array, [match_type])

For [match_type], you'll almost always use 0 for an exact match. So, to find the position of "Cappuccino" in our product list, we'd use =MATCH("Cappuccino", B2:B5, 0). The formula would return 3, because "Cappuccino" is the 3rd item in the range B2:B5.

The INDEX MATCH Power Combo

Now, let's combine them. This is where the magic happens. We use MATCH to find the row number, and then feed that number directly into the INDEX function to retrieve the data we want.

Let's use this combo to do something VLOOKUP can't: find the Product ID for the "Latte". We want to look in column B and retrieve a value from column A.

The formula would be: =INDEX(A2:A5, MATCH("Latte", B2:B5, 0))

Let’s walk through how Excel processes this:

  1. Inside-out: Excel starts with the MATCH function. MATCH("Latte", B2:B5, 0) searches for "Latte" in the product name column and finds it in the 2nd position. So, the MATCH function evaluates to the number 2.

  2. Substitution: The formula now effectively becomes =INDEX(A2:A5, 2).

  3. Final Result: The INDEX function looks at the Product ID range (A2:A5) and returns the 2nd value in that list, which is 102.

This combination is a favorite among Excel users because it's fast, flexible, and can look up data in any direction. It can also handle columns being inserted or deleted without breaking, which is a common problem with VLOOKUP.

Now that you've seen how VLOOKUP, INDEX, and MATCH work, let's test your understanding.

Quiz Questions 1/5

What is the primary function of VLOOKUP in Excel?

Quiz Questions 2/5

Consider the formula =VLOOKUP("Latte", A2:D5, 3, FALSE). What does the number 3 represent?

Mastering these functions is a big step in becoming more efficient with your data.