1. Lighthouse

Level 2 · Check and compare coupon orders in Excel

The request

From Laura Bennett, Head of Finance

“Priya exported completed orders by coupon and year, with what the baskets were worth before and after the discount. Check the discounts look right, then give me one small table: orders, revenue, average order and discount cost for each code, and its share of revenue.”

Your goal

Step 1 of 2. Check the discounts. In F2:F22, compute the share of the gross that was discounted: 1 minus net divided by gross (one formula, filled down). In G2:G22, the discount cost: gross minus net. Then in J2 return the highest rate with MAX, and in J3 count the rows with a rate of 0 with COUNTIF.

  • Fill F2:G22, J2:J3 with the right valuesnot done yet
  • With formulas, not typed numbersnot done yet
  • Use MAX COUNTIFnot done yet

Step 1 · your sheet

Excel
The sheet for this level
ABCDEFGHIJKLMNO
1couponyearordersgrossnetdiscount_ratediscount_cost
2BFCM2520237942595.9031946.93Highest discount rate
3BFCM25202412669340.1152005.08Rows with no discount
4BFCM25202510755464.5641598.42
5FREESHIP20234625264.1525264.15
6FREESHIP20245633994.8833994.88couponordersrevenueaovdiscount_costrevenue_share
7FREESHIP20257952723.0252723.02BFCM25
8HOLIDAY2020234220814.1516651.32FREESHIP
9HOLIDAY2020245627151.9121721.53HOLIDAY20
10HOLIDAY2020257636047.3428837.87SPRING15
11SPRING1520233519177.8116301.14SUMMER15
12SPRING1520245829931.4625441.74WELCOME10
13SPRING1520257758771.5649955.83none
14SUMMER1520234640342.1134290.79Total
15SUMMER1520246946075.5939164.25
16SUMMER1520258547931.5640741.83
17WELCOME102023199102015.0891813.57
18WELCOME10202414069281.9562353.75
19WELCOME10202519396684.2287015.80
20none202324341384263.501384263.50
21none202431681759394.031759394.03
22none202536782000817.382000817.38
23
24

Loading the editor…

    ResultPress Check to compare F2:G22, J2:J3

    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
    ABCDEFGHIJKLMNO
    1couponyearordersgrossnetdiscount_ratediscount_cost
    2BFCM2520237942595.9031946.9325.0%10648.97Highest discount rate25.0%
    3BFCM25202412669340.1152005.0825.0%17335.03Rows with no discount6
    4BFCM25202510755464.5641598.4225.0%13866.14
    5FREESHIP20234625264.1525264.150.0%0.00
    6FREESHIP20245633994.8833994.880.0%0.00couponordersrevenueaovdiscount_costrevenue_share
    7FREESHIP20257952723.0252723.020.0%0.00BFCM25
    8HOLIDAY2020234220814.1516651.3220.0%4162.83FREESHIP
    9HOLIDAY2020245627151.9121721.5320.0%5430.38HOLIDAY20
    10HOLIDAY2020257636047.3428837.8720.0%7209.47SPRING15
    11SPRING1520233519177.8116301.1415.0%2876.67SUMMER15
    12SPRING1520245829931.4625441.7415.0%4489.72WELCOME10
    13SPRING1520257758771.5649955.8315.0%8815.73none
    14SUMMER1520234640342.1134290.7915.0%6051.32Total
    15SUMMER1520246946075.5939164.2515.0%6911.34
    16SUMMER1520258547931.5640741.8315.0%7189.73
    17WELCOME102023199102015.0891813.5710.0%10201.51
    18WELCOME10202414069281.9562353.7510.0%6928.20
    19WELCOME10202519396684.2287015.8010.0%9668.42
    20none202324341384263.501384263.500.0%0.00
    21none202431681759394.031759394.030.0%0.00
    22none202536782000817.382000817.380.0%0.00
    23
    24

    Loading the editor…

      ResultPress Check to compare J7:N13, J14:K14, M14

      Mote checks your result

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

      The lesson

      What the sheet holds

      Priya’s export has one row per coupon and year, completed orders only:

      column holds
      A, B the coupon (none = no code) and the year
      C the number of orders
      D gross: what the baskets were worth before the discount
      E net: what customers paid

      Twenty-one rows: seven codes, three years each. The labels of the summary table are already in I6:N14.

      Step 1: does the discount match the code?

      The data has the code and the money, so you can work out the discount customers really got and compare it with the one advertised:

      F2   =1-E2/D2
      G2   =D2-E2

      Filled down to row 22, column F should show 25% on every BFCM25 row, 20% on HOLIDAY20 and so on. Two summary cells make the check quick to read:

      J2   =MAX(F2:F22)
      J3   =COUNTIF(F2:F22,0)

      The highest rate should be the biggest code, 25%. The zero rows should be exactly the six with no discount on the lines: none and FREESHIP, which waives shipping and leaves the basket alone.

      Step 2: one summary table

      The summary repeats one pattern: a SUMIFS that reads its coupon from column I.

      J7   =SUMIFS($C$2:$C$22,$A$2:$A$22,$I7)

      The data ranges are locked so they stay put when you fill down, and $I7 lets the row move. Revenue and discount cost use the same shape on columns E and G. Then the derived columns:

      L7   =K7/J7
      N7   =K7/$K$14

      with the totals in row 14. Fill everything down to row 13.

      Reading the result

      Coupons brought 12.8% of net revenue and cost $121,785 in discounts. Every code’s AOV is below the $554.36 of orders without one, from $386.27 on HOLIDAY20 to $618.69 on FREESHIP.

      Be careful with that comparison. Seasonal codes run in weeks when everybody’s baskets differ, so “coupon AOV below no-coupon AOV” mixes the coupon with the calendar. The SQL and pandas versions of this step compare each code with orders on the same days; in a spreadsheet you would need the daily export to do the same.

      Pitfalls

      • AOV and share come from totals; never average a column of averages.
      • #DIV/0! in the share column means the total reference was not locked.
      • FREESHIP’s real cost is shipping, which is not in this sheet. Say so in the write-up.

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