The request

From Charles Ruiz, Data Analyst
Your goal
In J1, count the missing unit costs in E2:E41 with COUNTBLANK. In F2:F41, each product's cost share (unit_cost divided by unit_price), or empty text "" when the cost is missing. In J2, the MEDIAN of the cost shares. In G2:G41, the cost to use: the recorded cost, or the price times the median share in J2 when the cost is missing. In H2:H41, the decision: the text in J4 for an estimated cost, the text in J5 for a recorded one.
- Fill
F2:H41, J1:J2with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
COUNTBLANKMEDIANIFnot done yet
Your sheet
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | product_id | name | category | unit_price | unit_cost | cost_share | cost_used | decision | Missing unit_cost | ||
| 2 | 101 | Vale Velvet Loveseat | Furniture | 1659.00 | Median cost share | ||||||
| 3 | 102 | Alder Oak Coffee Table | Furniture | 919.00 | 503.50 | ||||||
| 4 | 103 | Orchard Rattan Dining Chair | Furniture | 789.00 | 429.87 | Decision if missing | estimated: price x median cost share | ||||
| 5 | 104 | Upland Oak Bookcase | Furniture | 429.00 | 214.70 | Decision if recorded | as recorded | ||||
| 6 | 105 | Avery Leather Bed Frame | Furniture | 449.00 | 232.70 | ||||||
| 7 | 106 | Northfield Rattan Sectional | Furniture | 229.00 | 79.35 | ||||||
| 8 | 107 | Birch Teak Side Table | Furniture | 169.00 | 54.61 | ||||||
| 9 | 108 | Ashford Leather Dining Chair | Furniture | 369.00 | 139.71 | ||||||
| 10 | 109 | Oakley Oak Bookcase | Furniture | 999.00 | 389.90 | ||||||
| 11 | 110 | Linen Velvet Headboard | Furniture | 179.00 | 85.20 | ||||||
| 12 | 111 | Tidewater Teak Loveseat | Furniture | 629.00 | |||||||
| 13 | 112 | Vale Walnut Coffee Table | Furniture | 519.00 | 186.28 | ||||||
| 14 | 113 | Bayside Rattan Dining Chair | Furniture | 1379.00 | 788.42 | ||||||
| 15 | 114 | Rowan Walnut Dresser | Furniture | 279.00 | 121.87 | ||||||
| 16 | 115 | Weston Ash Bed Frame | Furniture | 1599.00 | |||||||
| 17 | 116 | Orchard Teak Sofa | Furniture | 689.00 | 338.88 | ||||||
| 18 | 117 | Orchard Walnut Side Table | Furniture | 439.00 | 178.30 | ||||||
| 19 | 118 | Willow Ash Lounge Chair | Furniture | 1609.00 | 878.40 | ||||||
| 20 | 119 | Alder Linen Sideboard | Furniture | 259.00 | |||||||
| 21 | 120 | Sable Oak Daybed | Furniture | 1209.00 | |||||||
| 22 | 201 | Orchard Aluminum Adirondack Chair | Outdoor | 51.99 | 19.56 | ||||||
| 23 | 202 | Pacifica Steel Planter | Outdoor | 289.00 | 147.85 | ||||||
| 24 | 203 | Northfield Teak Charcoal Grill | Outdoor | 53.99 | |||||||
| 25 | 204 | Laurel Teak Solar Lantern | Outdoor | 1289.00 | 508.79 | ||||||
| 26 | 205 | Maple Aluminum Patio Dining Set | Outdoor | 1099.00 | 584.22 | ||||||
| 27 | 206 | Driftwood Acacia Planter | Outdoor | 219.00 | |||||||
| 28 | 207 | Cedar Concrete Grill Tool Set | Outdoor | 72.99 | |||||||
| 29 | 208 | Ashford Wicker Solar Lantern | Outdoor | 74.99 | 24.66 | ||||||
| 30 | 209 | Sable Concrete Adirondack Chair | Outdoor | 50.99 | 19.35 | ||||||
| 31 | 210 | Linen Aluminum Raised Garden Bed | Outdoor | 669.00 | 305.73 | ||||||
| 32 | 211 | Linden Aluminum Grill Tool Set | Outdoor | 969.00 | 327.46 | ||||||
| 33 | 212 | Harbor Acacia Solar Lantern | Outdoor | 289.00 | 118.36 | ||||||
| 34 | 213 | Pine Wicker Patio Dining Set | Outdoor | 239.00 | 106.45 | ||||||
| 35 | 214 | Copper Steel Raised Garden Bed | Outdoor | 259.00 | 121.03 | ||||||
| 36 | 215 | Marlow Concrete Charcoal Grill | Outdoor | 93.99 | 39.48 | ||||||
| 37 | 216 | Tidewater Concrete String Lights | Outdoor | 379.00 | 217.56 | ||||||
| 38 | 217 | Marlow Concrete Patio Dining Set | Outdoor | 779.00 | 373.25 | ||||||
| 39 | 218 | Fern Concrete Raised Garden Bed | Outdoor | 779.00 | 408.40 | ||||||
| 40 | 219 | Upland Teak Grill Tool Set | Outdoor | 249.00 | 128.06 | ||||||
| 41 | 220 | Oakley Steel Solar Lantern | Outdoor | 869.00 | 322.08 | ||||||
| 42 | |||||||||||
| 43 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
What Charles gets, and why
The lesson
A blank cell is a question, not an answer. The cost wasn’t recorded, or it was lost, or it doesn’t apply. Before anything else, find out how many there are and decide, column by column, what a blank should become. Then write the decision down next to the data.
Find the gaps
| Method | How |
|---|---|
| Count | =COUNTBLANK(E2:E41) counts the empty cells: 8 here |
| Filter | Data > Filter, open the column’s arrow: a (Blanks) entry means there are empty cells; tick only it to see them |
| Compare | =COUNTA(E2:E41) gives 32 filled cells out of 40 rows |
Run the count on every column before you analyse a new export. It is the fastest part of a first
look at data quality: here unit_price has no blanks, unit_cost has 8 (products 101, 111,
115, 119, 120, 203, 206 and 207).
Three ways to treat a blank
| Option | When it fits | Here |
|---|---|---|
| Drop the row | few blanks, many rows, and the row isn’t needed | no: 8 of 40 is a fifth of the range, and the products sell |
| A fixed value | the blank has a clear meaning (0, Unknown, not recorded) |
no: a cost of 0 makes every margin 100% |
| An estimate (median, average) | the value exists but is unknown, and a typical value is defensible | yes, with a label |
The same store makes different choices in different columns. customers.city is blank for 14
customers: write Unknown and keep them, since an estimated city means nothing.
customers.referral_source is blank for 666: that is “not recorded”, a real answer that belongs
in its own category, not a gap to fill.
Estimate from a share, with the median
A median cost would be a bad estimate: =MEDIAN(E2:E41) is 200.49, which is more than the $53.99 price of the grill in row 24, and an eighth of the loveseat’s. These products run from $50.99 to $1,659. Cost scales
with price, so estimate the share of the price that is cost, then apply it:
F2 =IF(E2="","",E2/D2)
J2 =MEDIAN(F2:F41)
G2 =IF(E2="",D2*$J$2,E2)
F3 shows 54.8% (503.50 / 919). MEDIAN sorts the 32 shares and takes the middle (with 32 values, the average of the two middle ones): 45.1%. It
skips the empty text in the eight blank rows, like every function that summarises a range. The
average share is close here, 44.9%, but the median is the safer habit: one product with a
mistyped cost would drag the average and leave the median almost where it was.
G2, the Vale Velvet Loveseat at $1,659, gets an estimated cost of 748.53. G3 keeps its
recorded 503.50, and G24, the $53.99 grill, gets 24.36.
Write down why
Charles has to defend these numbers. The decision column says, row by row, which rule produced the value:
H2 =IF(E2="",$J$4,$J$5)
The wording lives in J4 and J5, so it is the same on every row and can be changed in one
place. When finance sends the real costs, sort or filter on column H and replace exactly the
eight estimates.
Common mistakes
- Filling the original column. Keep
unit_costas exported and put the filled value next to it, or nobody can tell an estimate from a fact. 0as a placeholder. It looks like data and flows into every total and average.- A blank that isn’t blank. A cell with a space in it looks empty, but
COUNTBLANKdoesn’t count it.=COUNTIF(E2:E41," ")finds those. - Estimating without a label. An estimate with no decision column becomes a fact the moment the sheet is forwarded.
Lantern lit!
Practised: missing valuescountblankmedianimputationifdata cleaning
- Solved
- No hints
- First run
