How many orders landed in the period (COUNTIFS)
The problem
Problem statement
The ops review asks for the number of orders placed inside a custom period, not a month. Dates sit in B2:B6 as ISO text, and the period limits are F1 (from) and F2 (to), both inclusive. Put the count in the Orders cell F3.
Both limits come from F1 and F2 — the same formula must work when the period moves.
Problem data
Show the sheet as a table (selectable, copyable)
| A | B | C | E | F | |
|---|---|---|---|---|---|
| 1 | Order | Date | Amount | From | 2026-02-01 |
| 2 | SO-1 | 2026-01-20 | 120 | To | 2026-03-05 |
| 3 | SO-2 | 2026-02-03 | 80 | Orders | |
| 4 | SO-3 | 2026-02-18 | 300 | ||
| 5 | SO-4 | 2026-03-01 | 60 | ||
| 6 | SO-5 | 2026-03-15 | 210 |
Notes
Two criteria on the same range is allowed: COUNTIFS(B2:B6, ">="&F1, B2:B6, "<="&F2). The operators are strings joined to the cell with &, and ISO dates compare correctly as text because year comes first. Inclusive limits mean an order dated exactly F1 or F2 counts.
How to approach
Your answer goes in F3. On submit we re-run your formula against 3 different sets of input, so a hardcoded number will fail — the formula has to follow the cells.
- Target cell is F3
- COUNTIFS takes range/criteria pairs
- Two pairs, both on B2:B6, joined with &
- Shape: =COUNTIFS(?, ?, ?, ?)
Official solutions
Show 2 solutions — try it yourself first
Approach 1: two criteria on one range
=COUNTIFS(B2:B6, ">="&F1, B2:B6, "<="&F2)
2026-02-01 to 2026-03-05 takes in SO-2 (02-03), SO-3 (02-18) and SO-4 (03-01): 3 orders. SO-1 is too early and SO-5 too late.
Approach 2: subtract the ones before the window
=COUNTIFS(B2:B6, "<="&F2) - COUNTIF(B2:B6, "<"&F1)
Everything up to F2 is 4 orders, minus the 1 placed before F1, leaves 3. Subtraction of counts is the same logic and is often easier to audit.
Function guide
FAQ
How do I count records between two dates?
=COUNTIFS(range, ">="&start, range, "<="&end). Both criteria target the same date column and both limits are inclusive.
Why does my date criteria return 0?
The operator is inside the quotes and the cell is outside: "<="&F2. Writing "<=F2" compares against the literal text F2.