Sub topic 9
Filtering by Date and Date Ranges
Assume you know how to enter Google Sheets formulas, use ranges such as A2:A100, and distinguish text, numbers, and dates. This chapter focuses on using COUNTIFS, SUMIFS, and AVERAGEIFS with date conditions.
How Sheets stores dates
Google Sheets stores a date as a number. The displayed format, such as 2026-01-15 or Jan 15, 2026, is only a presentation format. Date criteria work reliably when the cells contain real date values rather than text that looks like a date.
Suppose your data has these columns:
| Column | Meaning |
|---|---|
| A | Region |
| C | Order date |
| E | Revenue |
To count West-region orders on or after January 1, 2026, write:
=COUNTIFS(A2:A100, "West", C2:C100, ">="&DATE(2026,1,1))DATE(2026,1,1) creates a date value. The >= operator includes January 1.
Using a date range
A range usually needs a start and an end condition. To count West orders during January 2026, use January 1 as the inclusive start and February 1 as the exclusive end:
=COUNTIFS(A2:A100, "West", C2:C100, ">="&DATE(2026,1,1), C2:C100, "<"&DATE(2026,2,1))The same pattern works with SUMIFS and AVERAGEIFS. Remember that the sum or average range comes first:
=SUMIFS(E2:E100, A2:A100, "West", C2:C100, ">="&DATE(2026,1,1), C2:C100, "<"&DATE(2026,2,1))This formula adds revenue only when both conditions are true: the region is West and the order date falls in January.
Using an exclusive end boundary, such as < February 1, is safer than using <= January 31. It still works when date cells contain times, such as January 31, 2026 15:30.
Date criteria from cells
Put the start date in H1 and the end date in H2. Then build the criteria by joining the operator to each cell with &:
=SUMIFS(E2:E100, C2:C100, ">="&H1, C2:C100, "<"&H2)Changing H1 or H2 updates the result without editing the formula. To include the end date when your data contains dates without times, use "<="&H2. For timestamped data, set H2 to the next day and keep the exclusive < condition.
Common errors
All criteria ranges must have the same number of rows. For example, E2:E100 and C2:C100 match, but C2:C99 does not. Also check that the date column contains dates, not text, and that the end boundary is not earlier than the start boundary.
Exercise
Write a formula that counts all orders dated from March 1, 2026 through March 31, 2026, including both dates.
Show answer
=COUNTIFS(C2:C100, ">="&DATE(2026,3,1), C2:C100, "<"&DATE(2026,4,1))