Skip to content
GridBelt
  • Excel Test
  • Practice
  • Programs
  • Pricing
Sign in
Start the free test
  • Excel Test
  • Practice
  • Programs
  • Pricing
Sign inCreate account
Start the free test
GridBelt

Practice Excel in your browser.

Excel Test

  • Level 1: Beginner
  • Level 2: Intermediate
  • Level 3: Expert
  • Excel test in 7 days
  • Leaderboard
  • Excel test for interview
  • Indeed Excel assessment

Practice

  • All exercises
  • Programs
  • For beginners

Guides

  • Excel formulas
  • Excel shortcuts

Company

  • About
  • Pricing
  • How we grade

© GridBelt. All rights reserved.

  • Privacy Policy
  • Terms of Use
  • Refund Policy

Excel is a trademark of Microsoft Corporation. Indeed, TestGorilla, SHL and other marks are the property of their owners. GridBelt is an independent practice site and is not affiliated with, endorsed by or sponsored by Microsoft, TestGorilla, SHL or Indeed.

  1. Practice
  2. /
  3. COUNTIF and COUNTIFS

COUNTIFS practice: count orders between two dates in 300 rows

  • Intermediate
  • ~6 min
  • COUNTIF and COUNTIFS

The order log holds 300 orders from July to October 2026 with the order date in column B. The monthly report asks how many orders fall inside a reporting period whose start and end dates are typed into H2 and H3 — August at the moment, but the same sheet is reused every month. Count the orders from the start date to the end date, both days included, with a formula that reads the two date cells.

What you need to do

  1. 1Click H4. The order dates are in B2:B301; the period starts on the date in H2 and ends on the date in H3.
  2. 2A date condition in COUNTIFS is text joined to a cell: ">="&H2 means "on or after the date in H2" and "<="&H3 means "on or before the date in H3". Each condition needs its own copy of the date range.
  3. 3Write COUNTIFS with the two pairs — B2:B301 with ">="&H2, then B2:B301 with "<="&H3 — and press Enter.
  4. 4Change H2 to 2026-08-15: the count must fall; set it back and click Check (Ctrl+Enter / ⌘+Return).

Answer cells

Feedback

Type your formula in the grid, press Enter, then Check. We grade the value in each answer cell and the formula behind it.

Tasks

  1. Not checkedIn H4, count the orders whose date in B2:B301 is between the start date in H2 and the end date in H3 (both inclusive), using COUNTIFS with the two date cells as criteria.

Desktop recommended for spreadsheet tasks. The sheet scrolls inside this box.

StartInsertFormulasDataView
A1fxPreparing your workbook…
A
B
C
D
E
F
G
H
I
J
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1

Enter your formula in the sheet, then check.

About this exercise

A 300-row dataset on one sheet, one answer cell, about 6 minutes. Graded in your browser: the value and the formula behind it, with feedback that names the fix.

How to solve it

  • H4=COUNTIFS(B2:B301,">="&H2,B2:B301,"<="&H3)

Dates are numbers in a spreadsheet, so "between two dates" is two numeric conditions on the same column: at least the start date and at most the end date. COUNTIFS applies both at once — each pair names the date column B2:B301 and a criterion built as an operator in quotes joined to the date cell with &, such as ">="&H2. Because the formula reads H2 and H3, next month's report only needs two new dates typed in, not a new formula.

Pitfall 1: writing ">=H2" inside the quotes makes the criterion the literal text ">=H2", which matches nothing — the & is what inserts the date's value, producing ">=46235" under the hood. Pitfall 2: ">" and "<" exclude the boundary days; period reports almost always mean inclusive, so use >= and <= — the grader has orders on both boundary dates. Pitfall 3: when the date column contains timestamps (with hours), "<="&H3 stops at midnight at the start of the end day; use "<"&(H3+1) to include the whole day. Pitfall 4: text that looks like a date ("2026-08-01" imported as text) is not a number and is never counted — convert it with DATEVALUE or Text to Columns first. Alternatives: SUMPRODUCT((B2:B301>=H2)*(B2:B301<=H3)) avoids the string-building and is handy inside bigger formulas; COUNTIF(B2:B301,">="&H2)-COUNTIF(B2:B301,">"&H3) subtracts the orders after the period; in Excel 365, ROWS(FILTER(B2:B301,(B2:B301>=H2)*(B2:B301<=H3))) lists and counts at once.

Other ways that work

  • =SUMPRODUCT((B2:B301>=H2)*(B2:B301<=H3)) — array form without string criteria
  • =COUNTIF(B2:B301,">="&H2)-COUNTIF(B2:B301,">"&H3) — two single-condition counts subtracted (uses COUNTIF, which this task does not accept)
  • =COUNTIFS(B2:B301,">="&$H$2,B2:B301,"<="&$H$3) — absolute references; same result, handy when the formula is copied elsewhere

Common mistakes

Typing the dates into the criteria (">=2026-08-01") or forgetting the &: the comparison then happens against text, the count comes out as 0 or as the whole column, and changing H2 or H3 does nothing — the grader changes both cells and expects the count to follow.

How we grade

Any formula that produces the right result is accepted, unless the task names a function: then another function earns half credit. We compare values with a small tolerance and ignore case and spaces in text. A correct number typed by hand instead of a formula earns half credit. Multi-cell tasks earn full credit at 100% of cells, half credit from 50%. Where it matters, we also change an input cell on a copy of your sheet and check that your formula follows.

Answers computed with Excel 365 rules and checked in our grading engine on November 16, 2026. Author: GridBelt team.

In these programs

  • Excel for Data AnalystsDay 2

Related exercises

  • Orders per region and month with COUNTIFSIntermediate, ~7 min
  • Orders per status with COUNTIFBeginner, ~5 min
  • Total of orders above $500Beginner, ~4 min

Function reference

Official documentation

Next exercise

Sales by region with SUMIF