How to keep prices in one place with a price list and XLOOKUP

· 6 min read

When prices are typed by hand, the same mug ends up at 299 on one order and 289 on another, and nobody can say which is right. The cure is to type each price exactly once, on one tab, and have every other tab look it up.

The steps are for Google Sheets. The example is a shop selling mugs, plates and teapots, with no currency assumed.

Build the price list

Add a tab called Price list with SKU in column A, Product in B and Unit price in C:

SKU Product Unit price
M-101 Blue mug 299
M-103 Speckled mug 349
P-201 Dinner plate 449
T-401 Teapot 999

Three rules keep it dependable:

  • One row per product. Two rows for the same SKU means two prices.
  • A SKU that never changes. Product names get reworded. A short code such as M-101 does not.
  • A price that is only a number. Type 299, not "299 each".

Look up the price wherever you sell

Add a tab called Orders with these headers in row 1:

A B C D E F
Order ID SKU Quantity Product Unit price Line total

Columns A to C are typed. Put these in D2, E2 and F2:

Product =IF(B2="", "", XLOOKUP(B2, 'Price list'!A:A, 'Price list'!B:B, "SKU not found"))

Unit price =IF(B2="", "", XLOOKUP(B2, 'Price list'!A:A, 'Price list'!C:C))

Line total =IF(B2="", "", ROUND(C2*E2, 2))

Fill all three down to row 200. The IF(B2="", "", ...) part keeps a row blank until a SKU is typed.

XLOOKUP takes the SKU, finds it in column A of the price list and returns the cell from the same row of the column you point at. Google's page lists an exact match as the default, so M-10 never settles for M-101. The fourth part is what to show when nothing matches. Unit price leaves it out, and the page gives #N/A as the result in that case.

Check it against four rows

Type columns A to C and the rest should appear:

Order ID SKU Quantity Product Unit price Line total
O-501 P-201 60 Dinner plate 449 26,940.00
O-502 M-101 12 Blue mug 299 3,588.00
O-503 T-401 2 Teapot 999 1,998.00
O-504 M-109 5 SKU not found #N/A #N/A

The last row has a mistyped SKU. The error is the point: a line with no price should stop you, not total zero.

Now change the dinner plate from 449 to 479 on the price list. Without touching the Orders tab, O-501 becomes 60 times 479, which is 28,740.00. It also means old rows move, which the quote calculator guide deals with by pasting sent quotes as values.

A Quotes tab or an Invoices tab uses the same formulas, pointed at the same list.

Why XLOOKUP and not VLOOKUP

VLOOKUP does the same job with =VLOOKUP(B2, 'Price list'!A:C, 3, FALSE), and it is fine if you already use it. The differences that matter for a price list, taken from Google's pages for each function:

XLOOKUP VLOOKUP
Where the SKU column sits Anywhere It must be the first column of the range
How you choose what to return You point at the column You give a column number, here 3
If you leave out the last part Exact match Treated as sorted, which is an approximate match

The second row is where VLOOKUP price lists usually break. Insert a column between Product and Unit price, and column 3 is no longer the price. The XLOOKUP formula points at the column itself and follows it when it moves.

The third row is the dangerous one. A VLOOKUP without FALSE on an unsorted list can return another product's price without any error. Google's page recommends FALSE.

Excel has XLOOKUP too, but Microsoft's page says it is not available in Excel 2016 and Excel 2019. If the file may be opened there, use the VLOOKUP form.

Catch a SKU that appears twice

By default XLOOKUP searches from the first entry to the last, so if M-101 is on the list twice, the first row wins and the second is ignored. Make duplicates visible:

  1. On the Price list tab, select A2 down to A200.
  2. Choose Format > Conditional formatting.
  3. Under Format cells if, pick Custom formula is and enter =COUNTIF($A$2:$A$200, A2)>1.
  4. Choose a fill colour and click Done.

Any SKU that appears more than once is now coloured. Google's page on conditional formatting uses this formula as its own example. COUNTIF is not case sensitive, so m-101 and M-101 are flagged as the same code.

Fix a SKU that will not match

When a SKU is on the list and the price still shows #N/A, look for a space after the code. "M-101 " is not "M-101". Select the SKU columns on both tabs and choose Data > Data cleanup > Trim whitespace. Google's page on data cleanup says it removes leading, trailing and excessive spaces.

Better still, stop the typing. Select B2 to B200 on the Orders tab, choose Data > Data validation > Add rule, pick Dropdown from a range and enter 'Price list'!A2:A. Google's page on dropdown lists says an entry that is not on the list is rejected by default.

Raise every price by a percentage

  1. On the Price list tab, type the rise in F1, for example 5%.
  2. In D2 enter =ROUND(C2*(1+$F$1), 2) and fill it down. The mug shows 313.95, the speckled mug 366.45, the plate 471.45 and the teapot 1,048.95.
  3. Check the new prices before they go live.
  4. Copy D2 down to the last price, click C2 and choose Edit > Paste special > Paste values only. Google's page on copy and paste says this pastes only the text from the copied cells.
  5. Clear column D and F1, then retype any price you want to end in a rounder figure.

Share one price list between files

If orders and quotes live in separate spreadsheets, keep the price list in one of them and import it into the others. In the other file, add an empty tab called Price list and put this in A1, with the address of the file that holds the prices:

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/abcd123abcd123", "'Price list'!A1:C200")

The first time, the cell shows #REF! with a prompt to connect the sheets. Click Allow access. If you do not own the file with the prices, its owner has to grant the access. The lookups in that file then work as before.

One limit to know: Google's page on IMPORTRANGE says it checks for updates every hour while the document is open, and reloads when a document is first opened. A price changed a minute ago may not have reached the other file yet.

Where BoltSheets fits

Everything above works in a plain Google Sheet. The BoltSheets quote calculator template is built the same way: a Price list tab with SKU, Product, Unit price and Unit cost, and a Quotes tab that looks each price up, using INDEX and MATCH where this guide uses XLOOKUP. It has no duplicate check and does not import from another file. In the demo you can ask in words for a price to be changed. The change is shown as a preview and written only when a person confirms it, and formula cells are never written to. BoltSheets is in early access and works with Google Sheets only. The template opens as a demo for now and is not yet a sheet you can copy.

Common questions

Does XLOOKUP work in Excel?

The same formula works in Excel for Microsoft 365, Excel 2021 and Excel 2024. Microsoft's page says XLOOKUP is not available in Excel 2016 and Excel 2019. If anyone on your team opens the file in one of those, use the VLOOKUP form shown in this guide instead.

Can one XLOOKUP return the product name and the price together?

Yes. Point the third part at both columns, as in =XLOOKUP(B2, 'Price list'!A:A, 'Price list'!B:C). Google's page says that when the result range is more than one column, the output is the entire row. The cell to the right of the formula must be empty, because the price lands there.

Will changing a price change my old orders?

Yes. Every row reads the price list live, so last month's rows move with it. When an order is invoiced, copy its formula cells and paste them back over themselves as values only. The row then keeps the price it was sold at.

How do I keep a separate wholesale price for each product?

Add a Wholesale price column to the price list, in column D, and have the lookup choose which column to read. With the customer type in G2, use =IF(G2="Wholesale", XLOOKUP(B2, 'Price list'!A:A, 'Price list'!D:D), XLOOKUP(B2, 'Price list'!A:A, 'Price list'!C:C)).