1. Lighthouse

Level 6 · Missing values, and a reason for each fix

The request

From Charles Ruiz, Data Analyst

“I'm building the margin report for Furniture and Outdoor. Some products have no unit cost on file and finance won't have them before Friday. I can't drop them and I can't leave them blank. Can you fill them with a sensible estimate, and mark which costs are estimates and why?”

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:J2 with the right valuesnot done yet
  • With formulas, not typed numbersnot done yet
  • Use COUNTBLANK MEDIAN IFnot done yet

Your sheet

Excel
The sheet for this level
ABCDEFGHIJK
1product_idnamecategoryunit_priceunit_costcost_sharecost_useddecisionMissing unit_cost
2101Vale Velvet LoveseatFurniture1659.00Median cost share
3102Alder Oak Coffee TableFurniture919.00503.50
4103Orchard Rattan Dining ChairFurniture789.00429.87Decision if missingestimated: price x median cost share
5104Upland Oak BookcaseFurniture429.00214.70Decision if recordedas recorded
6105Avery Leather Bed FrameFurniture449.00232.70
7106Northfield Rattan SectionalFurniture229.0079.35
8107Birch Teak Side TableFurniture169.0054.61
9108Ashford Leather Dining ChairFurniture369.00139.71
10109Oakley Oak BookcaseFurniture999.00389.90
11110Linen Velvet HeadboardFurniture179.0085.20
12111Tidewater Teak LoveseatFurniture629.00
13112Vale Walnut Coffee TableFurniture519.00186.28
14113Bayside Rattan Dining ChairFurniture1379.00788.42
15114Rowan Walnut DresserFurniture279.00121.87
16115Weston Ash Bed FrameFurniture1599.00
17116Orchard Teak SofaFurniture689.00338.88
18117Orchard Walnut Side TableFurniture439.00178.30
19118Willow Ash Lounge ChairFurniture1609.00878.40
20119Alder Linen SideboardFurniture259.00
21120Sable Oak DaybedFurniture1209.00
22201Orchard Aluminum Adirondack ChairOutdoor51.9919.56
23202Pacifica Steel PlanterOutdoor289.00147.85
24203Northfield Teak Charcoal GrillOutdoor53.99
25204Laurel Teak Solar LanternOutdoor1289.00508.79
26205Maple Aluminum Patio Dining SetOutdoor1099.00584.22
27206Driftwood Acacia PlanterOutdoor219.00
28207Cedar Concrete Grill Tool SetOutdoor72.99
29208Ashford Wicker Solar LanternOutdoor74.9924.66
30209Sable Concrete Adirondack ChairOutdoor50.9919.35
31210Linen Aluminum Raised Garden BedOutdoor669.00305.73
32211Linden Aluminum Grill Tool SetOutdoor969.00327.46
33212Harbor Acacia Solar LanternOutdoor289.00118.36
34213Pine Wicker Patio Dining SetOutdoor239.00106.45
35214Copper Steel Raised Garden BedOutdoor259.00121.03
36215Marlow Concrete Charcoal GrillOutdoor93.9939.48
37216Tidewater Concrete String LightsOutdoor379.00217.56
38217Marlow Concrete Patio Dining SetOutdoor779.00373.25
39218Fern Concrete Raised Garden BedOutdoor779.00408.40
40219Upland Teak Grill Tool SetOutdoor249.00128.06
41220Oakley Steel Solar LanternOutdoor869.00322.08
42
43

Loading the editor…

    ResultPress Check to compare F2:H41, J1:J2

    Mote checks your result

    Press Check. Each right cell becomes a firefly in your lantern.

    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_cost as exported and put the filled value next to it, or nobody can tell an estimate from a fact.
    • 0 as 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 COUNTBLANK doesn’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.

    Pick what may run on this site. You can change this any time from "Cookie settings" at the bottom of every page.