Find a customer's city with VLOOKUP

Beginner

Customer data is often stored in a reference table that you query by ID. VLOOKUP is a quick way to pull information from that table without searching row by row.

VLOOKUP searches for a value in the first column of a table and returns a value from another column in the same row. Its syntax is:

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
  • lookup_value: the value you want to find (the customer ID)
  • table_array: the range that contains the data to search
  • col_index_num: which column of the table to return (counting from the left edge of table_array)
  • range_lookup: use FALSE for an exact match

Your task

The customer directory is in cells A1:D7. Below it, cell B9 contains a customer ID, and cell B10 is where you need to enter your formula.

  1. Click cell B10.
  2. Write a VLOOKUP formula that looks up the customer ID in B9 in the directory table.
  3. Return the city for that customer.
  4. Use FALSE as the last argument so Excel only matches the exact customer ID.

Need some help?

Hint 1

Your table_array should cover all four columns of the directory (A2:D7), and range_lookup should be FALSE for an exact match.

Hint 2

City is the 3rd column in your table_array (A2:D7), so col_index_num is 3.

Related function(s)