The request

From Logan Brooks, Email Marketing Specialist
Your goal
In H3, count the orders with any coupon code in D2:D59 (COUNTIF with a wildcard). In H4, count the orders whose subtotal (E2:E59) is at least the threshold in H1 (COUNTIF, criterion built from H1 with &). In H5, add up the subtotals of orders whose status (C2:C59) is neither cancelled nor refunded (SUMIFS with two <> conditions).
- Fill
H3:H5with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
COUNTIFSUMIFSnot done yet
Your sheet
| A | B | C | D | E | F | G | H | I | |
|---|---|---|---|---|---|---|---|---|---|
| 1 | order_id | channel | status | coupon_code | subtotal | Big basket from | 250.00 | ||
| 2 | 12166 | app | completed | BFCM25 | 256.40 | ||||
| 3 | 12167 | web | completed | 330.93 | Orders with a coupon | ||||
| 4 | 12168 | app | completed | BFCM25 | 500.85 | Big baskets | |||
| 5 | 12169 | app | completed | BFCM25 | 17.99 | Revenue kept | |||
| 6 | 12170 | web | completed | 308.00 | |||||
| 7 | 12171 | web | completed | 378.00 | |||||
| 8 | 12172 | app | completed | 283.96 | |||||
| 9 | 12173 | app | cancelled | 33.98 | |||||
| 10 | 12174 | web | cancelled | BFCM25 | 3149.12 | ||||
| 11 | 12175 | app | completed | 139.00 | |||||
| 12 | 12176 | web | completed | BFCM25 | 45.74 | ||||
| 13 | 12177 | web | completed | 41.98 | |||||
| 14 | 12178 | web | completed | 384.96 | |||||
| 15 | 12179 | app | completed | 200.99 | |||||
| 16 | 12180 | web | completed | BFCM25 | 1403.25 | ||||
| 17 | 12181 | marketplace | completed | 412.92 | |||||
| 18 | 12182 | app | refunded | 1258.92 | |||||
| 19 | 12183 | app | completed | 167.93 | |||||
| 20 | 12184 | web | completed | BFCM25 | 29.99 | ||||
| 21 | 12185 | web | completed | 234.96 | |||||
| 22 | 12186 | web | completed | 421.99 | |||||
| 23 | 12187 | app | refunded | BFCM25 | 78.71 | ||||
| 24 | 12188 | app | completed | 65.98 | |||||
| 25 | 12189 | app | completed | 60.99 | |||||
| 26 | 12190 | app | completed | BFCM25 | 106.48 | ||||
| 27 | 12191 | web | completed | 161.95 | |||||
| 28 | 12192 | app | cancelled | BFCM25 | 21.74 | ||||
| 29 | 12193 | web | completed | 772.94 | |||||
| 30 | 12194 | app | completed | 17.99 | |||||
| 31 | 12195 | app | completed | 43.98 | |||||
| 32 | 12196 | app | completed | 582.89 | |||||
| 33 | 12197 | app | completed | BFCM25 | 1667.99 | ||||
| 34 | 12198 | app | completed | BFCM25 | 420.73 | ||||
| 35 | 12199 | marketplace | completed | BFCM25 | 112.48 | ||||
| 36 | 12200 | app | completed | 2252.97 | |||||
| 37 | 12201 | web | completed | BFCM25 | 39.74 | ||||
| 38 | 12202 | marketplace | completed | BFCM25 | 19.49 | ||||
| 39 | 12203 | app | completed | BFCM25 | 74.98 | ||||
| 40 | 12204 | marketplace | completed | 510.95 | |||||
| 41 | 12205 | app | completed | BFCM25 | 105.74 | ||||
| 42 | 12206 | web | completed | 805.94 | |||||
| 43 | 12207 | app | completed | 16.99 | |||||
| 44 | 12208 | app | completed | BFCM25 | 171.74 | ||||
| 45 | 12209 | app | completed | 189.00 | |||||
| 46 | 12210 | web | completed | BFCM25 | 62.97 | ||||
| 47 | 12211 | app | completed | BFCM25 | 520.41 | ||||
| 48 | 12212 | app | completed | BFCM25 | 551.21 | ||||
| 49 | 12213 | app | completed | 17.99 | |||||
| 50 | 12214 | app | completed | BFCM25 | 216.75 | ||||
| 51 | 12215 | web | completed | 676.00 | |||||
| 52 | 12216 | app | completed | BFCM25 | 163.50 | ||||
| 53 | 12217 | web | completed | 77.98 | |||||
| 54 | 12218 | marketplace | completed | 229.98 | |||||
| 55 | 12219 | app | completed | 11.99 | |||||
| 56 | 12220 | app | completed | 1265.00 | |||||
| 57 | 12221 | app | completed | BFCM25 | 95.23 | ||||
| 58 | 12222 | app | completed | BFCM25 | 39.74 | ||||
| 59 | 12223 | app | completed | 65.98 | |||||
| 60 | |||||||||
| 61 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
What Logan gets, and why
The lesson
So far the criteria were plain values: app, completed, or a cell holding one. A criterion
can also hold an operator and wildcards. That turns COUNTIF and SUMIFS into small
filters: “at least 250”, “anything but cancelled”, “any coupon at all”.
Operators in a criterion
The criterion is text, so the operator goes inside the quotes with the value:
| Criterion | Matches |
|---|---|
">=250" |
numbers 250 and up |
">250" |
numbers above 250 (250 itself is out) |
"<100" |
numbers below 100 |
"<>cancelled" |
every cell that is not cancelled, blanks included |
"completed" or "=completed" |
exactly completed (any case) |
"" |
empty cells |
On this sheet =COUNTIF(E2:E59,">=250") counts the orders of 250 or more: 23 of 58. As in chapter
1, decide what happens at the edge. “Baskets of $250 and up” is >=; “over $250” is >.
Building a criterion from a cell with &
Logan keeps moving the line, so it lives in H1. The tempting formula is wrong:
=COUNTIF(E2:E59,">=H1")
Everything inside quotes is literal text, so this compares each subtotal with the word H1 and
returns 0. Instead, keep the operator in quotes and join the cell to it with &:
H4 =COUNTIF(E2:E59,">="&H1)
">="&H1 is evaluated first and becomes the text >=250. Change H1 to 100 and H4 updates. The
same trick works for any operator and for dates: "<="&G2, "<>"&B1.
Wildcards
In a text criterion, * stands for any run of characters (including none) and ? for exactly
one character:
| Criterion | Matches |
|---|---|
"BF*" |
codes that start with BF, like BFCM25 |
"*15" |
codes that end in 15, like SPRING15 and SUMMER15 |
"*" |
any text at all, so every filled-in cell |
"~*" |
a literal asterisk (the ~ escapes it) |
Blank cells hold no text, so "*" skips them. That makes =COUNTIF(D2:D59,"*") the count of
orders that used a coupon: 25. On Sunday every one of them was BFCM25, so =COUNTIF(D2:D59,"BF*")
also gives 25. Wildcards only work on text; "2*" will not find numbers that start with 2.
Two “not” tests on one column
“Leave cancelled and refunded out” needs two conditions on the status column. SUMIFS accepts
the same range twice:
H5 =SUMIFS(E2:E59,C2:C59,"<>cancelled",C2:C59,"<>refunded")
A row is kept only when it passes both tests, so cancelled rows fail the first and refunded rows
fail the second. The result, 17,756.51, equals =SUMIF(C2:C59,"completed",E2:E59) today, because
this day has no pending orders. The two formulas differ when a new status appears: the <>
version keeps it, the completed version drops it. Pick the one that matches the definition your
team uses.
Common mistakes
- Cell reference inside the quotes.
">=H1"is the text H1, not the value in H1. - Two
<>tests joined in one string."<>cancelled,refunded"looks for that exact text. Use two pairs. <>and blank cells."<>cancelled"also matches empty status cells. On a clean export that’s fine; on a messy one it can sweep in rows you didn’t mean. The next level looks at this.- Wildcards on numbers.
*and?match text only.
Lantern lit!
Practised: criteriawildcardsconcatenationcountifsumifs
- Solved
- No hints
- First run
