Lookup Functions
Intermediate

Look up a part when the code is not in the first column

The lookup VLOOKUP cannot do, because the answer sits to the left of the key.

Task:

A customer rings the parts counter and reads out code BLT-330. The price list is sorted by part name, so the codes sit in column B. Put the part name in B9 and the unit price in B10.

Learning Objectives:

  • Find a row number with MATCH and an exact match
  • Read a value off that row with INDEX
  • Look up a value to the left of the key, which VLOOKUP cannot do
Hints

Solve without hints for +5 XP

Interactive Spreadsheet

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

ABCD
1PartCodeSupplierUnit price
2Brake pad setBRK-114Fenwick38.5
3Oil filterFLT-207Hollis12.75
4Timing beltBLT-330Fenwick64.9
5Spark plugPLG-052Ardent6.4
6Wiper bladeWPR-418Hollis15.25
7
8Code asked forBLT-330
9Part name
10Unit price
What this exercise teaches (contains the answer)

VLOOKUP can only return a column to the right of the one it searches, and here the part name sits to the left of the code, so it has nothing to offer. Splitting the problem removes the constraint: MATCH answers "which row?" and INDEX answers "what is in that row of this column?", and neither cares which side of the other they sit on. The same MATCH drives both answers, which is why changing the code in B8 updates them together.