The request

From Frank Bell, Account Executive
Your goal
In G5, return the largest subtotal (D2:D59) among orders whose status (C2:C59) equals G3 and whose order_date (B2:B59) is between G1 and G2, both days included, with MAXIFS. In G6, the smallest one with MINIFS. Build the date criteria from G1 and G2 with &.
- Fill
G5:G6with the right valuesnot done yet - With formulas, not typed numbersnot done yet
- Use
MAXIFSMINIFSnot done yet
Your sheet
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | order_id | order_date | status | subtotal | Promo starts | 2025-11-28 | ||
| 2 | 11830 | 2025-11-17 | completed | 58.96 | Promo ends | 2025-12-01 | ||
| 3 | 11837 | 2025-11-17 | completed | 1226.84 | Status | completed | ||
| 4 | 11847 | 2025-11-17 | completed | 548.91 | ||||
| 5 | 11853 | 2025-11-18 | completed | 235.89 | Largest order | |||
| 6 | 11861 | 2025-11-18 | completed | 5216.96 | Smallest order | |||
| 7 | 11868 | 2025-11-18 | completed | 1442.94 | ||||
| 8 | 11874 | 2025-11-19 | completed | 365.88 | ||||
| 9 | 11878 | 2025-11-19 | completed | 2268.99 | ||||
| 10 | 11880 | 2025-11-19 | completed | 161.97 | ||||
| 11 | 11881 | 2025-11-19 | refunded | 2173.91 | ||||
| 12 | 11883 | 2025-11-19 | completed | 854.96 | ||||
| 13 | 11887 | 2025-11-19 | cancelled | 395.92 | ||||
| 14 | 11902 | 2025-11-20 | completed | 1846.00 | ||||
| 15 | 11936 | 2025-11-22 | completed | 1396.00 | ||||
| 16 | 11945 | 2025-11-22 | completed | 198.98 | ||||
| 17 | 11947 | 2025-11-22 | cancelled | 3943.86 | ||||
| 18 | 11957 | 2025-11-23 | completed | 3974.93 | ||||
| 19 | 11958 | 2025-11-23 | completed | 756.91 | ||||
| 20 | 11969 | 2025-11-23 | refunded | 1487.92 | ||||
| 21 | 11973 | 2025-11-23 | completed | 1021.84 | ||||
| 22 | 11978 | 2025-11-24 | cancelled | 1786.95 | ||||
| 23 | 11980 | 2025-11-24 | cancelled | 363.94 | ||||
| 24 | 11988 | 2025-11-24 | completed | 329.88 | ||||
| 25 | 11991 | 2025-11-24 | completed | 782.90 | ||||
| 26 | 11996 | 2025-11-24 | completed | 79.96 | ||||
| 27 | 12027 | 2025-11-26 | completed | 70.99 | ||||
| 28 | 12028 | 2025-11-26 | completed | 657.87 | ||||
| 29 | 12037 | 2025-11-27 | completed | 272.92 | ||||
| 30 | 12050 | 2025-11-27 | completed | 1070.89 | ||||
| 31 | 12062 | 2025-11-28 | completed | 339.86 | ||||
| 32 | 12073 | 2025-11-28 | completed | 227.95 | ||||
| 33 | 12082 | 2025-11-28 | completed | 100.48 | ||||
| 34 | 12085 | 2025-11-28 | completed | 1754.97 | ||||
| 35 | 12094 | 2025-11-28 | completed | 976.31 | ||||
| 36 | 12107 | 2025-11-28 | completed | 1062.81 | ||||
| 37 | 12124 | 2025-11-29 | completed | 338.23 | ||||
| 38 | 12126 | 2025-11-29 | completed | 72.71 | ||||
| 39 | 12141 | 2025-11-29 | completed | 572.23 | ||||
| 40 | 12161 | 2025-11-29 | completed | 2218.48 | ||||
| 41 | 12174 | 2025-11-30 | cancelled | 3149.12 | ||||
| 42 | 12180 | 2025-11-30 | completed | 1403.25 | ||||
| 43 | 12193 | 2025-11-30 | completed | 772.94 | ||||
| 44 | 12215 | 2025-11-30 | completed | 676.00 | ||||
| 45 | 12244 | 2025-12-01 | completed | 1722.71 | ||||
| 46 | 12267 | 2025-12-01 | cancelled | 393.96 | ||||
| 47 | 12289 | 2025-12-01 | completed | 583.98 | ||||
| 48 | 12300 | 2025-12-02 | completed | 149.94 | ||||
| 49 | 12322 | 2025-12-03 | completed | 462.83 | ||||
| 50 | 12341 | 2025-12-03 | completed | 480.96 | ||||
| 51 | 12347 | 2025-12-04 | completed | 259.96 | ||||
| 52 | 12381 | 2025-12-05 | completed | 1676.94 | ||||
| 53 | 12383 | 2025-12-05 | completed | 26.09 | ||||
| 54 | 12402 | 2025-12-06 | completed | 884.97 | ||||
| 55 | 12408 | 2025-12-06 | completed | 77.94 | ||||
| 56 | 12425 | 2025-12-07 | completed | 3476.00 | ||||
| 57 | 12445 | 2025-12-07 | completed | 113.92 | ||||
| 58 | 12460 | 2025-12-08 | completed | 759.97 | ||||
| 59 | 12465 | 2025-12-08 | completed | 359.97 | ||||
| 60 | ||||||||
| 61 |
Loading the editor…
Reference solution
Mote checks your result
Press Check. Each right cell becomes a firefly in your lantern.
What Frank gets, and why
The lesson
SUMIFS adds up the matching rows and AVERAGEIFS averages them. Two more members of the family
pick the extremes: MAXIFS returns the largest matching value and MINIFS the smallest. Combined
with date criteria, they answer “what was our biggest order during the sale?” in one cell.
MAXIFS and MINIFS
=MAXIFS(max_range, range1, criteria1, range2, criteria2, …)
=MINIFS(min_range, range1, criteria1, …)
The argument order is the SUMIFS order: the range to search first, then the pairs. For the
largest completed order on the whole sheet:
=MAXIFS(D2:D59,C2:C59,"completed")
That gives 5,216.96, an order from November 18, before the promo started. Frank wants the promo only, so the formula needs a date window.
A date window from two cells
Dates in a spreadsheet are numbers: each day is one more than the day before. That means the usual operators work on them. “From G1 to G2, both days included” is two conditions on the same column:
B2:B59, ">="&G1, B2:B59, "<="&G2
As in level 4, the operator stays in quotes and the cell is joined with &. Typing a date inside
the quotes, like ">=2025-11-28", can work, but how Excel reads typed dates depends on the
computer’s regional settings. A date in a cell is the same everywhere.
Put together, with the status in G3:
G5 =MAXIFS(D2:D59,C2:C59,G3,B2:B59,">="&G1,B2:B59,"<="&G2)
G6 =MINIFS(D2:D59,C2:C59,G3,B2:B59,">="&G1,B2:B59,"<="&G2)
G5 shows 2,218.48 and G6 72.71.
Every condition earns its place
Try removing one at a time and watch G5:
| Conditions | Largest order |
|---|---|
| status and both dates | 2,218.48 |
| both dates, no status | 3,149.12 (a cancelled order) |
| status, no dates | 5,216.96 (November 18) |
A number that looks impressive is often a filter that’s missing. When an extreme surprises you,
find the row it comes from before you report it. =XLOOKUP(G5,D2:D59,A2:A59) from chapter 2
returns the order id: 12161, placed on November 29.
When nothing matches
MAXIFS and MINIFS return 0 when no row passes the tests, not an error. Set G3 to
pending: there are no pending orders in this window, and both cells show 0. A “smallest order
of 0” is a sign the filter found nothing, so check the inputs before you read it as a free order.
AVERAGEIFS is more honest here, with #DIV/0!.
Common mistakes
- Dates with times. This sheet stores plain dates. If
order_dateheld a time too,"<="&G2would stop at midnight at the start of December 1 and drop that day’s orders. Use"<"&G2+1(before the next day) for timestamps. >instead of>=.">"&G1silently drops the first day of the promo, Black Friday itself.- Older Excel.
MAXIFSandMINIFSarrived in Excel 2019; Microsoft 365 and Google Sheets have them. In Excel 2016 they show#NAME?. - Quotes around the cell.
">=G1"compares with the text G1 and nothing matches.
Lantern lit!
Practised: maxifsminifsdate criteriacriteriaconcatenation
- Solved
- No hints
- First run
