The request

From Mei Morgan, Buyer
Your goal
In C2:C33, use VLOOKUP with an exact match (FALSE) to return each line's list price, the 4th column of the catalog F2:I36, looking up the product_id in column B. In D2:D33, return the category, the catalog's 3rd column, the same way. Wrap both in IFERROR so a product that isn't in the catalog shows the text "not in catalog".
- Fill
C2:D33with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
VLOOKUPnot done yet
Your sheet
| A | B | C | D | E | F | G | H | I | J | |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | order_item_id | product_id | list_price | category | product_id | name | category | unit_price | ||
| 2 | 19128 | 190 | 161 | Cove Jute Duvet Cover | Textiles | 219.00 | ||||
| 3 | 19129 | 190 | 162 | Oakley Jute Knit Throw | Textiles | 23.99 | ||||
| 4 | 19130 | 162 | 164 | Cove Wool Lumbar Pillow | Textiles | 52.99 | ||||
| 5 | 19132 | 189 | 165 | Weston Cashmere-Blend Quilt | Textiles | 25.99 | ||||
| 6 | 19134 | 194 | 166 | Harbor Wool Knit Throw | Textiles | 28.99 | ||||
| 7 | 19135 | 185 | 168 | Upland Percale Lumbar Pillow | Textiles | 159.00 | ||||
| 8 | 19138 | 186 | 169 | Spruce Wool Duvet Cover | Textiles | 66.99 | ||||
| 9 | 19140 | 173 | 170 | Rowan Cashmere-Blend Throw Blanket | Textiles | 17.99 | ||||
| 10 | 19141 | 194 | 171 | Driftwood Percale Area Rug | Textiles | 27.99 | ||||
| 11 | 19142 | 183 | 172 | Maple Wool Throw Pillow | Textiles | 18.99 | ||||
| 12 | 19143 | 186 | 173 | Bramble Percale Quilt | Textiles | 139.00 | ||||
| 13 | 19148 | 193 | 174 | Vale Cashmere-Blend Knit Throw | Textiles | 18.99 | ||||
| 14 | 19149 | 178 | 175 | Glen Cotton Runner Rug | Textiles | 84.99 | ||||
| 15 | 19150 | 186 | 176 | Fairhaven Cotton Throw Pillow | Textiles | 78.99 | ||||
| 16 | 19152 | 175 | 177 | Delancey Cashmere-Blend Duvet Cover | Textiles | 169.00 | ||||
| 17 | 19154 | 198 | 178 | Sutton Wool Knit Throw | Textiles | 70.99 | ||||
| 18 | 19156 | 199 | 179 | Delancey Jute Area Rug | Textiles | 30.99 | ||||
| 19 | 19157 | 173 | 180 | Hazel Linen Throw Pillow | Textiles | 20.99 | ||||
| 20 | 19158 | 190 | 181 | Cedar Marble Bud Vase | Decor | 179.00 | ||||
| 21 | 19159 | 193 | 182 | Nantucket Brass Wall Mirror | Decor | 17.99 | ||||
| 22 | 19160 | 198 | 184 | Thatcher Oak Candle | Decor | 17.99 | ||||
| 23 | 19164 | 194 | 185 | Ridge Brass Bud Vase | Decor | 12.99 | ||||
| 24 | 19166 | 164 | 186 | Birch Brass Floor Mirror | Decor | 20.99 | ||||
| 25 | 19168 | 193 | 187 | Ashford Oak Canvas Print | Decor | 149.00 | ||||
| 26 | 19170 | 178 | 188 | Fern Oak Candle Holder Set | Decor | 179.00 | ||||
| 27 | 19171 | 163 | 189 | Northfield Brass Bud Vase | Decor | 76.99 | ||||
| 28 | 19173 | 171 | 190 | Elm Brass Floor Mirror | Decor | 43.99 | ||||
| 29 | 19175 | 184 | 192 | Thatcher Marble Candle Holder Set | Decor | 15.99 | ||||
| 30 | 19176 | 191 | 193 | Delancey Brass Vase | Decor | 19.99 | ||||
| 31 | 19178 | 166 | 194 | Chester Brass Wall Mirror | Decor | 159.00 | ||||
| 32 | 19179 | 186 | 195 | Fairhaven Soy Wax Framed Print | Decor | 103.99 | ||||
| 33 | 19181 | 191 | 196 | Pine Glass Candle Holder Set | Decor | 25.99 | ||||
| 34 | 197 | Ridge Soy Wax Vase | Decor | 109.00 | ||||||
| 35 | 198 | Harbor Oak Floor Mirror | Decor | 44.99 | ||||||
| 36 | 199 | Oakley Brass Framed Print | Decor | 104.99 | ||||||
| 37 | ||||||||||
| 38 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
What Mei gets, and why
The lesson
Order lines store a product_id, not a price or a category: those live once, in the catalog.
To see them next to each line you look them up: find the line’s id in the catalog and bring
back a value from the same row. VLOOKUP is the oldest way to do it, and the one you will meet
most in shared workbooks. In this sheet the lines are in A1:D33 and the Decor and Textiles
catalog sits on the right in F1:I36.
The four arguments
=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
| Argument | In C2 | Means |
|---|---|---|
lookup_value |
B2 |
the id to find (190) |
table_array |
$F$2:$I$36 |
the whole catalog; the ids must be in its first column |
col_index_num |
4 |
which column of the table to return, counting from F as 1 |
range_lookup |
FALSE |
exact match only |
For row 2, VLOOKUP finds 190 in column F and returns the 4th column of that row: 43.99. Change
the 4 to a 3 and the same formula returns the category, Decor. The column number counts inside
the table, not across the sheet: F is 1, G is 2, H is 3, I is 4. Ask for column 5 and VLOOKUP
shows #REF!, because this table has only four.
Always write FALSE
The last argument is optional, and its default is TRUE: an approximate match. VLOOKUP then
assumes the ids are sorted and settles for the largest id that isn’t above the one you asked for.
On this catalog, sorted by id, that sounds harmless until a key is missing. Product 183 was
dropped, and =VLOOKUP(183,$F$2:$I$36,4) returns 17.99, the price of product 182, the
Nantucket Brass Wall Mirror. No error, just a wrong price. With FALSE, the same formula shows
#N/A, which is the truth: 183 isn’t in the catalog.
IFERROR for ids that aren’t there
Four lines in this sheet are for dropped products: 183 (row 11), 163 (row 27) and 191 (rows 30 and 33).
Each shows #N/A. IFERROR replaces an error with a value you choose:
=IFERROR(VLOOKUP(B2,$F$2:$I$36,4,FALSE),"not in catalog")
If the lookup works, IFERROR passes its result through; if it fails, the cell says “not in catalog”. Filled down, 19 lines come back as Decor, 9 as Textiles and 4 as not in catalog: 32, one per line.
IFNA does the same but only for #N/A. That difference matters: with a wrong column number,
IFERROR(VLOOKUP(B2,$F$2:$I$36,5,FALSE),…) hides the #REF! and calls a real product “not in
catalog”, while IFNA lets the #REF! show so you can fix the formula. Both behave the same in
Google Sheets. Text is also safer than 0 as the fallback in a price column: a 0 gets added into
totals, text doesn’t.
Common mistakes
- No
FALSE. Missing ids silently borrow the price of their neighbour. - Counting columns from A. The price is column 4 of
F2:I36, not column 9 of the sheet. - Unlocked table.
F2:I36filled down becomesF3:I37, and the first products drop out of the search one row at a time. Lock it:$F$2:$I$36. - A table that starts at the wrong column. VLOOKUP only searches the first column of the
table you give it.
$G$2:$I$36searches names, not ids.
Lantern lit!
Practised: vlookupexact matchiferrorifnalookups
- Solved
- No hints
- First run
