Menu

Chapter 09 · 8 min · Basic

Bringing in the other sheet

The question is how much did we sell in each city, and the orders file has no city column. It has a customer id. The cities live in somebody else's list.

So you bring the two together. This is the most ordinary thing an analyst does, and it has two failure modes that both end with a report that looks finished: rows that match the wrong copy, and rows that match nothing and vanish from the total.

Neither one raises an error. Both are cheap to check first, and almost impossible to spot afterwards.

The grid

Two blocks on one grid. Orders in A1:C11order_id, customer_id, amount_myr. The customer list in E1:G6customer_id, name, city. The engine here has one sheet, so the second block sits beside the first rather than on its own tab; everything works the same way. Work in column I.

Pulling the city across

XLOOKUP is the bridge: take the customer id off the order row, find it in the customer list's id column, bring back the matching city.

Row 2 belongs to C-001, the list says Penang, and Penang is what arrives.

That is the whole mechanic, and it is genuinely this simple when both sides behave. The rest of this chapter is about the two ways they do not — and the reason to learn them here rather than later is that the formula looks exactly the same in both cases.

Order row 2 belongs to customer C-001, who the list says is in Penang. What comes back?

I2

Scroll to see all 9 columns →

ABCDEFGHI
1order_idcustomer_idamount_myrcustomer_idnamecity
27001C-00141.00C-001AisyahPenang=XLOOKUP(B2,$E$2:$E$6,$G$2:$G$6)
37002C-00262.50C-002Wei MingKuala Lumpur
47003C-003128.75C-003PriyaJohor Bahru
57004C-00133.20C-005HafizPenang
67005C-00487.50C-002Wei MingIpoh
77006C-00271.15
87007C-00396.40
97008C-00527.00
107009C-00148.00
117010C-00519.90
Editable, try changing it

Basic

The rest of this chapter is Basic

The Excel tutorial and Spreadsheet Fundamentals are free here, forever. This track is the paid half: what to actually do with a spreadsheet once somebody sends you one, from the first look to a summary you can defend.

See Basic plans

RM 25/mo · cancel anytime

Still to come in this chapter

  1. 02One answer, even when there are two
  2. 03Check the other side is unique first
  3. 04The orders that match nobody
  4. 05Count the money before you bring anything across
  5. 06The order of operations