Course / Lookups

VLOOKUP: exact matches

Turn a product code into its name, price and stock level, straight from a table. Intermediate · 4 min · VLOOKUP, Exact match, col_index_num

VLOOKUP searches down the first column of a table for a value, then returns something from the same row. It turns a code like GC-147 into a product name, a price or a stock level, so you never have to hunt for it by eye.

=VLOOKUP(lookup_value, table_array, col_index_num, range_lookup)

Steps

  1. The SKU to look up is in G2. In G3, return its product name, which is column 2 of the table: =VLOOKUP(G2, A2:D9, 2, FALSE)

  2. In G4, look up the price. It is the same formula with a different column number, because Price is column 3 of the table.

  3. Finish the card: in G5, return how many are in stock.

  4. Now the payoff. Type GC-122 into G2 and watch all three answers update at once.

Remember

Previous: SUMPRODUCT · Next: Approximate match for tiers and bands