The request

From Andrew Ramos, Marketing Manager
Your goal
In G2:G41, return TRUE for each line whose channel (column C) equals the channel in J1 AND whose category (column E) equals either J2 or J3, and FALSE otherwise; use AND with OR inside. In J5, count the TRUE rows with COUNTIF. In J6, add up their line_total (column F) with SUMIF.
- Fill
G2:G41, J5:J6with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
ANDORnot done yet
Your sheet
| A | B | C | D | E | F | G | H | I | J | K | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | order_id | order_date | channel | product | category | line_total | keep | Channel | web | ||
| 2 | 10946 | 2025-09-15 | web | Cedar Concrete Grill Tool Set | Outdoor | 72.99 | Category 1 | Kitchen | |||
| 3 | 10948 | 2025-09-15 | app | Harbor Acacia Solar Lantern | Outdoor | 578.00 | Category 2 | Decor | |||
| 4 | 10949 | 2025-09-15 | web | Thatcher Acacia Dutch Oven | Kitchen | 13.99 | |||||
| 5 | 10949 | 2025-09-15 | web | Delancey Brass Vase | Decor | 19.99 | Lines kept | ||||
| 6 | 10950 | 2025-09-15 | web | Willow Acacia Knife Block | Kitchen | 53.99 | Revenue kept | ||||
| 7 | 10951 | 2025-09-15 | web | Ashford Linen Pendant Light | Lighting | 349.00 | |||||
| 8 | 10951 | 2025-09-15 | web | Delancey Jute Area Rug | Textiles | 30.99 | |||||
| 9 | 10951 | 2025-09-15 | web | Driftwood Percale Area Rug | Textiles | 27.99 | |||||
| 10 | 10952 | 2025-09-15 | web | Thatcher Marble Candle Holder Set | Decor | 31.98 | |||||
| 11 | 10952 | 2025-09-15 | web | Cove Jute Duvet Cover | Textiles | 219.00 | |||||
| 12 | 10953 | 2025-09-15 | marketplace | Tidewater Teak Loveseat | Furniture | 629.00 | |||||
| 13 | 10955 | 2025-09-15 | app | Maple Wool Throw Pillow | Textiles | 56.97 | |||||
| 14 | 10955 | 2025-09-15 | app | Monroe Glass Desk Lamp | Lighting | 239.92 | |||||
| 15 | 10955 | 2025-09-15 | app | Weston Cashmere-Blend Quilt | Textiles | 51.98 | |||||
| 16 | 10957 | 2025-09-16 | web | Cove Cast Iron Dutch Oven | Kitchen | 10.99 | |||||
| 17 | 10957 | 2025-09-16 | web | Orchard Walnut Side Table | Furniture | 439.00 | |||||
| 18 | 10957 | 2025-09-16 | web | Birch Brass Floor Mirror | Decor | 20.99 | |||||
| 19 | 10957 | 2025-09-16 | web | Oakley Enamel Dutch Oven | Kitchen | 109.00 | |||||
| 20 | 10957 | 2025-09-16 | web | Weston Ash Bed Frame | Furniture | 3198.00 | |||||
| 21 | 10958 | 2025-09-16 | app | Delancey Black Metal Wall Sconce | Lighting | 54.99 | |||||
| 22 | 10959 | 2025-09-16 | app | Nantucket Brass Wall Mirror | Decor | 17.99 | |||||
| 23 | 10959 | 2025-09-16 | app | Northfield Teak Charcoal Grill | Outdoor | 53.99 | |||||
| 24 | 10960 | 2025-09-16 | app | Glen Stoneware Carafe | Kitchen | 182.97 | |||||
| 25 | 10960 | 2025-09-16 | app | Cove Wool Lumbar Pillow | Textiles | 52.99 | |||||
| 26 | 10960 | 2025-09-16 | app | Vale Enamel Bowl Set | Kitchen | 95.92 | |||||
| 27 | 10960 | 2025-09-16 | app | Birch Brass Floor Mirror | Decor | 41.98 | |||||
| 28 | 10960 | 2025-09-16 | app | Quarry Ceramic Picture Light | Lighting | 658.00 | |||||
| 29 | 10961 | 2025-09-16 | web | Delancey Brass Vase | Decor | 19.99 | |||||
| 30 | 10961 | 2025-09-16 | web | Alder Oak Coffee Table | Furniture | 919.00 | |||||
| 31 | 10961 | 2025-09-16 | web | Vale Cashmere-Blend Knit Throw | Textiles | 37.98 | |||||
| 32 | 10961 | 2025-09-16 | web | Thatcher Oak Candle | Decor | 71.96 | |||||
| 33 | 10962 | 2025-09-16 | marketplace | Harbor Oak Floor Mirror | Decor | 89.98 | |||||
| 34 | 10962 | 2025-09-16 | marketplace | Ridge Soy Wax Vase | Decor | 109.00 | |||||
| 35 | 10963 | 2025-09-16 | app | Fairhaven Brass Wall Sconce | Lighting | 756.00 | |||||
| 36 | 10963 | 2025-09-16 | app | Monroe Glass Desk Lamp | Lighting | 29.99 | |||||
| 37 | 10963 | 2025-09-16 | app | Upland Percale Lumbar Pillow | Textiles | 159.00 | |||||
| 38 | 10963 | 2025-09-16 | app | Dune Black Metal Pendant Light | Lighting | 189.00 | |||||
| 39 | 10963 | 2025-09-16 | app | Glen Stoneware Carafe | Kitchen | 60.99 | |||||
| 40 | 10964 | 2025-09-16 | app | Vale Enamel Bowl Set | Kitchen | 23.98 | |||||
| 41 | 10964 | 2025-09-16 | app | Weston Ash Bed Frame | Furniture | 1599.00 | |||||
| 42 | |||||||||||
| 43 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
What Andrew gets, and why
The lesson
Andrew wants a slice of the data: web orders, Kitchen or Decor. In Excel you’d usually click your way there with a filter. That’s fine for looking, but the moment someone asks “how many, and how much?”, you want the rule written down where the numbers can follow it. This level does both.
Filtering in Excel
Click any cell in the data and turn on Data → Filter (Ctrl+Shift+L; Google Sheets: Data → Create a filter). Each header gets a drop-down arrow:
- Untick Select All, tick
webin the channel drop-down. - In the category drop-down, tick
KitchenandDecor.
Ticks inside one column are OR (Kitchen or Decor). Filters on different columns are AND (web and one of those categories). The drop-downs also have Text Filters (Contains, Begins With), Number Filters (Greater Than, Between, Top 10) and Date Filters (Before, After, This Month) for rules a tick list can’t express. The status bar shows “9 of 40 records found”, and a filter icon on the header reminds you the view is filtered.
While you scroll a long list, keep the headers in view with View → Freeze Panes → Freeze Top Row. Freeze Panes on a selected cell freezes everything above and to the left of it, handy when the id column should stay visible too.
Advanced Filter: the rule written in cells
Data → Advanced (Sort & Filter group) takes a criteria range: header names copied above the conditions. Conditions on the same row are AND, conditions on separate rows are OR:
| channel | category |
|---|---|
| web | Kitchen |
| web | Decor |
That reads “web AND Kitchen, OR web AND Decor”. Advanced Filter can also copy the matching rows to another place. It doesn’t update by itself, though: change the data and you have to run it again.
The same rule as a formula
A criteria column turns the filter into a TRUE/FALSE per row. With the inputs in J1:J3:
G2 =AND(C2=$J$1,OR(E2=$J$2,E2=$J$3))
Row 4 is order 10949, web, a Thatcher Acacia Dutch Oven in Kitchen: C4="web" is TRUE, E4="Kitchen"
is TRUE, so G4 is TRUE. Row 3 is a Solar Lantern bought in the app: the AND fails on the
channel, so G3 is FALSE, whatever the category. Text comparisons with = ignore case, so
"Web" would match too. The inputs are locked with $ because every row reads the same three
cells.
Then the answers Andrew asked for:
J5 =COUNTIF(G2:G41,TRUE)
J6 =SUMIF(G2:G41,TRUE,F2:F41)
Change J1 to app and both numbers update. That’s the advantage over a ticked filter: the rule
is visible, reusable, and checkable.
Filtered totals in Excel
A plain SUM(F2:F41) keeps adding hidden rows when a filter is on. Excel’s
SUBTOTAL(109, F2:F41) (or AGGREGATE) adds only the visible ones, and the Total Row of an
Excel Table uses it for you. The criteria column avoids the question altogether, because the
filter lives in the formula.
Common mistakes
- Putting every test in one
AND: a row can’t be Kitchen and Decor at once, so nothing matches. - Using
ORfor everything: that keeps every web line plus Kitchen and Decor lines from any channel. - Leaving
J1relative: filled down, it becomesJ2, thenJ3, and each row tests a different input. - Summing the visible rows of a filtered range with
SUMand reporting it as the filtered total.
Lantern lit!
Practised: autofilteradvanced filterandorcriteria columnfreeze panes
- Solved
- No hints
- First run
