1. Lighthouse

Level 2 · Clean and rank the states in Excel

The request

From Catherine Hale, CEO

“Ryan exported revenue and buyers for our eight biggest states, one row per state label exactly as customers typed it. Can you clean the labels, tell me how much was hiding under the messy ones, and give me one tidy row per state?”

Your goal

Step 1 of 2. Clean and flag. In E2:E26, clean each label with UPPER and TRIM (one formula, filled down). In F2:F26, return "ok" when the cleaned label is exactly the original and "fixed" when it is not, with IF and EXACT. Then in I2 count the "fixed" rows with COUNTIF, and in I3 total their 2025 revenue (column D) with SUMIF.

  • Fill E2:F26, I2:I3 with the right valuesnot done yet
  • With formulas, not typed numbersnot done yet
  • Use UPPER TRIM EXACT COUNTIF SUMIFnot done yet

Step 1 · your sheet

Excel
The sheet for this level
ABCDEFGHIJKLMN
1statebuyers_2025revenue_2024revenue_2025clean_statelabel_status
2 CA13,321.36149.00Labels fixed
3 FL10.006,019.152025 revenue on fixed labels
4 IL10.001,014.26
5 PA11,514.881,395.93staterevenue_2024revenue_2025growthbuyers_2025revenue_per_buyer
6 TX1975.9819.99CA
7CA186269,705.21276,630.20TX
8CA 175.98170.10NY
9FL10886,388.00124,036.54FL
10FL 10.001,045.90IL
11IL78151,885.44120,195.86PA
12IL 00.000.00MA
13MA4353,527.75106,731.06OH
14MA 10.001,266.88
15NY147256,301.88219,581.28
16OH4662,555.3692,571.24
17PA60102,626.60113,078.84
18PA 22,158.881,904.13
19TX146231,325.13236,369.71
20TX 20.003,869.69
21ca23,497.34420.61
22fl10.0093.98
23il10.00219.89
24ny10.00136.49
25oh1384.17390.91
26tx12,222.92124.75
27
28

Loading the editor…

    ResultPress Check to compare E2:F26, I2:I3

    Mote checks your result

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

    Step 2 · your sheet

    Excel
    The sheet for this level
    ABCDEFGHIJKLMN
    1statebuyers_2025revenue_2024revenue_2025clean_statelabel_status
    2 CA13,321.36149.00CAfixedLabels fixed17
    3 FL10.006,019.15FLfixed2025 revenue on fixed labels18,241.66
    4 IL10.001,014.26ILfixed
    5 PA11,514.881,395.93PAfixedstaterevenue_2024revenue_2025growthbuyers_2025revenue_per_buyer
    6 TX1975.9819.99TXfixedCA
    7CA186269,705.21276,630.20CAokTX
    8CA 175.98170.10CAfixedNY
    9FL10886,388.00124,036.54FLokFL
    10FL 10.001,045.90FLfixedIL
    11IL78151,885.44120,195.86ILokPA
    12IL 00.000.00ILfixedMA
    13MA4353,527.75106,731.06MAokOH
    14MA 10.001,266.88MAfixed
    15NY147256,301.88219,581.28NYok
    16OH4662,555.3692,571.24OHok
    17PA60102,626.60113,078.84PAok
    18PA 22,158.881,904.13PAfixed
    19TX146231,325.13236,369.71TXok
    20TX 20.003,869.69TXfixed
    21ca23,497.34420.61CAfixed
    22fl10.0093.98FLfixed
    23il10.00219.89ILfixed
    24ny10.00136.49NYfixed
    25oh1384.17390.91OHfixed
    26tx12,222.92124.75TXfixed
    27
    28

    Loading the editor…

      ResultPress Check to compare I6:M13

      Mote checks your result

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

      The lesson

      What the sheet holds

      Ryan’s export has one row per state label exactly as it is stored in customers, for the eight states with the most revenue in 2025:

      column holds
      A the state label as typed, spaces and lowercase included
      B buyers: customers with a completed order in 2025
      C, D net revenue from completed orders in 2024 and in 2025

      California alone appears as CA, ca, CA and CA. Sorted alphabetically, the labels with a leading space come first, which is often how you first notice them in a real export.

      Step 1: clean, then show what changed

      Cleaning a label takes two functions, nested:

      =UPPER(TRIM(A2))

      TRIM removes leading, trailing and doubled spaces; UPPER puts the letters in one case. A flag column then shows which rows the cleaning touched:

      =IF(EXACT(A2,E2),"ok","fixed")

      EXACT is the right test here because Excel’s = ignores case: ="ca"="CA" is TRUE. Two summary cells, COUNTIF of the flags and SUMIF of the 2025 revenue on the flagged rows, tell the reader how much was hiding under the messy labels.

      Step 2: one row per state

      With a clean label in column E, each measure is one SUMIF per state:

      I6  =SUMIF($E$2:$E$26,H6,$C$2:$C$26)

      The $ signs lock the data ranges, so the formula can be filled down to row 13 while H6 moves to H7, H8 and so on. Growth and revenue per buyer are then plain divisions on the totals.

      Reading the result

      state revenue_2025 growth revenue_per_buyer
      CA 277,369.91 0.3% 1,459.84
      TX 240,384.13 2.5% 1,602.56
      NY 219,717.77 −14.3% 1,484.58

      The three biggest states are close in size, but only California and Texas held their revenue. A state is still a large area: California’s revenue is spread across several metros, and part of every total is business accounts that would never visit a showroom.

      Pitfalls

      • A SUMIF on the raw labels comes out short without any error. Always total on the cleaned column.
      • =A2=E2 treats ca and CA as equal. Use EXACT when case matters.
      • Typing the totals instead of using formulas breaks the sheet the next time Ryan refreshes it.

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