← Excel Sales Reporting

Lesson 1 of 4

Look up a region

Join a sales row to a region using an explicit key.

Do the work

  1. Look up customer_id in the mapping table below.
  2. Use exact matches; an unknown customer must not inherit a nearby row.
  3. Keep every sale.

VLOOKUP and XLOOKUP practice: match a customer region

Use the same three sales as the first exercise. Customer 1 belongs to East, customer 2 to West, and customer 99 has no matching record. Keep all three sales and return Unknown for the unmatched key.

Download the sales CSV, then open it in Excel. The headers occupy A1:C1; customer IDs are in B2:B4 and the region answers belong in C2:C4. Enter this two-row mapping in E1:F3:

CellE: customer_idF: region
Row 21East
Row 32West

Put customer_id in E1 and region in F1. Keep the IDs numeric in both tables. Choose one formula for C2, then fill it down through C4:

VLOOKUP with an exact match

=IFNA(VLOOKUP(B2,$E$2:$F$3,2,FALSE),"Unknown")

FALSE requests an exact match. The mapping’s first column contains the key and its second column contains the region. IFNA returns the task’s Unknown label when the key is absent.

XLOOKUP with an explicit missing-key answer

=XLOOKUP(B2,$E$2:$E$3,$F$2:$F$3,"Unknown",0)

The final 0 requests an exact match. Use this formula in an Excel version that supports XLOOKUP. Dollar signs keep the mapping ranges fixed while the sales-row reference changes.

Check the answers
order_idcustomer_idregion
11East
22West
399Unknown

There are three sales before and after the lookup. Customer 99 must remain in the output.

The browser workbench accepts the completed CSV values. Its small LOOKUP function has its own exact-match behavior; VLOOKUP, XLOOKUP and IFNA must be run in Excel. Paste the three-column result into the customer-region practice to check it, or download all reporting exercises and answers.

Function references: Microsoft VLOOKUP documentation, Microsoft XLOOKUP documentation and Microsoft guidance on missing lookup values.

See the method

The mapping is 1 → East, 2 → West.

Read every demonstration step
  1. The mapping is 1 → East, 2 → West.
  2. LOOKUP uses exact matching in this workbench.
  3. Unknown customer 99 gets Unknown.

Watch the walkthrough

Read the video transcript
  1. Look up a region. The mapping is 1 → East, 2 → West.
  2. Look up a region. An unmatched customer is not a West customer.
  3. Calculate conditional totals. SUMIF tests a region range and sums its amount range.
  4. Calculate conditional totals. Do not mix the regions or omit the 100-dollar sale.
  5. Build a pivot-style summary. East PEN combines 6 and 9 into 15.
  6. Build a pivot-style summary. Grouping by region alone loses the product breakdown.
  7. Audit a report. Two units at 3 dollars gives 6.
  8. Audit a report. The PEN total should be 6, not 5.

The video works through all four course topics; the demonstration above focuses on this lesson.

Practice independently

Take it further

A production workbook may use XLOOKUP; this workbench uses a small exact LOOKUP.