Skip to content

Case study: price a trade order

Case study9 minPremium

Builds on Look up a value on another sheet, When a lookup can't find a match, Find a band or tax bracket with an approximate match, Find a position with XMATCH and Look up by row and column at once.

A sales assistant at a garden supplies wholesaler in Ohio prices trade orders in one workbook. The price list, the customer list and the rate tables each live on their own sheet, kept up to date by the teams that own them, and the order sheet only reads them.

How it works

A priced order is a chain of lookups, and each one asks a question of the list that owns the answer:

  • What does each item cost? An exact lookup of its code on the price list sheet, locked and filled down the order.
  • Who looks after this customer? An exact lookup of the customer ID, with IFNA for a customer who isn't on the list yet.
  • What discount applies? An approximate match of the subtotal in a table of starting points.
  • What does delivery cost? A two-way lookup of the zone and the weight in a rate table whose columns are upper limits.

Picture the order sheet as a form that asks and the lists as the people who answer. When a price or a rate changes, the team that owns the list changes it once, and every order that reads the list follows without anyone editing a formula.

Example

A florist's order sheet works out each line's total from the quantity in B2 and the price of the code in A2, which it looks up on a sheet called Stock with codes in A2:A60 and prices in D2:D60.

=B2*XLOOKUP(A2,Stock!$A$2:$A$60,Stock!$D$2:$D$60)
Multiplies the quantity in B2 by the price looked up for A2's code on the Stock sheet, with the Stock ranges locked so the formula fills down the order.

A lookup can sit inside any calculation: here it supplies the price, and the multiplication does the rest.

Common mistakes

  • A list's range that isn't locked works on the first line and fails further down. Lock every list before you fill.
  • An exact lookup in a band table shows #N/A for every amount between two starting points. Bands need TRUE, or XLOOKUP with -1.
  • IFNA around every lookup would also hide a code mistyped on the order. Use it only where a missing value is normal, such as a new customer.
  • Columns of upper limits need the next larger match, 1. The next smaller one undercharges.

In short

  • Each answer comes from the list that owns it, usually on its own sheet.
  • Exact lookups for codes and IDs, approximate ones for bands, and a two-way lookup for a rate table.
  • Lock the ranges, fill down, and test one value on the edge of each band.

Practice

Premium

4 formulas.

Practice is part of Premium

Every lesson is free to read, and you can practice the free lessons without an account. This lesson's exercises are part of Premium, which you add to a free account.