Lookup Functions
Intermediate

XLOOKUP with 0 as the fallback

A missing item should cost nothing in the total, not break it.

Task:

Some items on the order are freebies with no price on the list. In C2:C6 give each line's cost — quantity times the listed price, with unlisted items costing 0 — and the order total in C7.

Interactive Spreadsheet

Hints

+5 XPno-hints bonus

Solve it on your own to keep the bonus. Each hint gets one step closer to the formula.

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

7 rows × 6 columns6 cells you fill in
ABCDEF
1ItemQtyCostItemPrice
2Mug4Mug6
3Tote bag2Notebook4.5
4Notebook10Pen set8
5Sticker25
6Pen set3
7Total
What this exercise teachesMay contain the answer

A text fallback like "Not found" makes the multiplication fail, and one #VALUE! in the column breaks the total. Choosing 0 keeps the arithmetic going — appropriate here because free items really do cost nothing. Pick the fallback for what the missing case means, not out of habit.