1. Lighthouse

Level 2 · Count orders by channel and status

The request

From Robert Kim, Chief Operating Officer

“Support says the website had a bad Sunday on December 21. Before I call engineering: how many orders did each channel take that day, and how many of them were cancelled or refunded?”

Your goal

Build a PivotTable at H1 that counts the orders of December 21: channel in Rows, status in Columns, order_id in Values summarised by Count. It fills H1:L6.

  • Fill H1:L6 with the right valuesnot done yet

Your sheet

Excel
The sheet for this level
ABCDEFGHIJKLMN
1order_idorder_datechannelstatusshipping_fee
2127782025-12-21 02:14webcancelled0.00
3127792025-12-21 03:36appcompleted6.95
4127802025-12-21 05:30marketplacecompleted7.65
5127812025-12-21 06:53appcompleted0.00
6127822025-12-21 07:39webcompleted0.00
7127832025-12-21 08:16appcompleted0.00
8127842025-12-21 08:18webcancelled0.00
9127852025-12-21 09:42appcompleted0.00
10127862025-12-21 09:56webcompleted14.95
11127872025-12-21 09:57marketplacecompleted4.99
12127882025-12-21 10:08marketplacecompleted4.99
13127892025-12-21 10:36marketplacecompleted4.99
14127902025-12-21 10:43webcompleted0.00
15127912025-12-21 10:54appcompleted0.00
16127922025-12-21 12:26appcompleted6.95
17127932025-12-21 13:10appcompleted0.00
18127942025-12-21 13:43webcompleted0.00
19127952025-12-21 14:09webcompleted0.00
20127962025-12-21 14:47webcompleted6.95
21127972025-12-21 15:15appcompleted6.95
22127982025-12-21 15:47webcompleted0.00
23127992025-12-21 16:00webcancelled0.00
24128002025-12-21 16:08appcompleted0.00
25128012025-12-21 16:18appcompleted0.00
26128022025-12-21 16:44appcompleted0.00
27128032025-12-21 16:58webrefunded0.00
28128042025-12-21 18:03webcompleted0.00
29128052025-12-21 18:30webcompleted6.95
30128062025-12-21 18:53webcompleted14.95
31128072025-12-21 19:36webcancelled6.95
32128082025-12-21 19:38webcompleted0.00
33128092025-12-21 19:56webcancelled0.00
34128102025-12-21 19:57marketplacecompleted7.65
35128112025-12-21 21:22appcompleted0.00
36128122025-12-21 21:59appcompleted0.00
37
38
39
40
41

Loading the editor…

    ResultPress Check to compare H1:L6

    Mote checks your result

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

    The lesson

    The first PivotTable grouped in one direction. Most questions have two: “orders per channel, split by status”. A PivotTable puts the second field across the top, and every cell where a row and a column cross holds one number.

    Columns make a cross-tab

    The sheet holds the 35 orders placed on Sunday, December 21, in A1:E36. Build the PivotTable with:

    Box Field
    Rows channel
    Columns status
    Values order_id, summarised by Count

    The result at H1:

    Count of order_id   status
    channel        cancelled   completed   refunded   Grand Total
    app                               13                    13
    marketplace                        5                     5
    web                    5          11          1         17
    Grand Total            5          29          1         35

    The first row names the summary and the column field; the second row lists the column items, sorted A→Z, then Grand Total. Each row has its own Grand Total on the right, and the last row adds up each column.

    Count, not Sum

    To count records, put any field that is filled on every record into Values and switch “Summarise values by” to Count. order_id is the safest choice: every order has one. Count counts non-empty cells, so a field with gaps (a coupon code, say) would undercount.

    Excel picks the default for you: Sum when the field holds numbers, Count when it holds text. Here order_id is a number, so Excel would start with Sum of order_id. Always read the value header before you read the numbers.

    Empty cells mean “no records”

    app has no cancelled orders, so that cell is empty, not 0. A PivotTable only fills a cell when at least one record lands in it. If you want zeros, Excel has a setting for it (PivotTable Options → “For empty cells show: 0”). Leave them empty here; the checker expects exactly what a default PivotTable shows.

    Reading it

    Web took 17 orders and 5 of them were cancelled, while app and marketplace had none. That is 5 of the day’s 35 orders, all on one channel. One more refund on the web makes it 6 problem orders on the website alone. A pattern that sharp is worth a message to engineering.

    Common mistakes

    • Sum of order_id. Adding ids together gives a big number that means nothing.
    • Counting a field with gaps. Count of coupon_code counts only the orders that used a coupon. Use a field that every record has.
    • Swapping Rows and Columns. The numbers stay the same but the table turns sideways. Put the field with more items in Rows, so the table grows downwards and stays readable.
    • Reading an empty cell as missing data. It means zero records, not “unknown”.

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