0Pricing
Excel Formulas Academy · Lesson

Date Ranges in Criteria Functions

Use between-dates logic to sum or count within a period.

Date Ranges in Criteria Functions is a free Excel Formulas Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Excel Formulas Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

Filtering by Time Periods

Real reports almost always ask about a time window: sales this quarter, orders last month, signups between two dates. The criteria functions you've learned — SUMIFS, COUNTIFS, AVERAGEIFS — handle this beautifully once you know how to express a date range.

The trick is that a date range is really two conditions on the same date column: on or after a start, and on or before an end.

Dates Are Just Numbers

Spreadsheets store dates as serial numbers — day 1 is January 1, 1900 (or 1899 in Sheets), and each later day adds one. That's why you can compare dates with > and < exactly like ordinary numbers.

So after January 1 simply means a serial number greater than that date's number. This is the key insight that makes date filtering work.

A Between-Dates Sum

Suppose column A holds an Order Date and column C the Amount. To total sales from January 2024, you give column A twice: on or after Jan 1, and on or before Jan 31.

Wrap dates in the DATE(year, month, day) function so they're unambiguous across regional formats. The two conditions form an AND, capturing only the month's rows.

=SUMIFS(C:C, A:A, ">="&DATE(2024,1,1), A:A, "<="&DATE(2024,1,31))

Why DATE() and the & Symbol

You might try typing ">=1/1/2024" directly. It often works, but it's fragile — the spreadsheet may read it as text or misinterpret the day and month order.

The robust pattern is ">="&DATE(2024,1,1). The DATE function builds a real serial number, and the & glues the operator to it. This is reliable in both Excel and Google Sheets, in any locale.

=COUNTIFS(A:A, ">="&DATE(2024,1,1), A:A, "<="&DATE(2024,1,31))

Pulling Dates From Cells

Hard-coded dates are fine for a fixed report, but a flexible one reads the start and end from cells. Put the start date in F1 and the end date in F2.

Now the period is driven by the sheet. Change F1 or F2 and every total recalculates. As always, join the operator to the cell with & — never put the cell name inside the quotes.

=SUMIFS(C:C, A:A, ">="&F1, A:A, "<="&F2)

Open-Ended Ranges

Sometimes you only need one boundary. Everything from a date onward uses a single greater-than-or-equal condition. Everything up to a date uses a single less-than-or-equal condition.

This counts all orders placed on or after the date in F1, with no upper limit — useful for "sales since launch" style metrics.

=COUNTIFS(A:A, ">="&F1)

Combining Dates With Other Criteria

Date conditions mix freely with text and number conditions. To total East region sales within a date window, add the region pair alongside the two date pairs.

Order doesn't matter to the result — Excel evaluates all conditions as one big AND. Here three criteria pairs share the same average_range or sum_range.

=SUMIFS(C:C, B:B, "East", A:A, ">="&F1, A:A, "<="&F2)

Filtering by Month or Year

To total an entire year, set the bounds to the first and last day of that year. Combine DATE for the start with the end of the period.

For a single month, use the first of the month as the lower bound and the first of the next month with a strict "<" as the upper bound — a neat way to avoid worrying about 28, 30, or 31 days.

=SUMIFS(C:C, A:A, ">="&DATE(2024,3,1), A:A, "<"&DATE(2024,4,1))

Relative Windows With TODAY

For rolling reports, build the boundaries from TODAY(). To count orders in the last 30 days, the lower bound is today minus 30 and the upper bound is today.

Because TODAY() refreshes each day the sheet recalculates, the window slides forward automatically — no manual editing required.

=COUNTIFS(A:A, ">="&(TODAY()-30), A:A, "<="&TODAY())

Watch Out for Time Components

If your date column actually stores date and time (like a timestamp), a row dated late on Jan 31 has a serial number slightly above the whole-day value of Jan 31. A "<="&DATE(2024,1,31) bound would exclude it.

The safe fix is the next-day strict-less-than pattern: "<"&DATE(2024,2,1) captures every moment within January, timestamps included.

=SUMIFS(C:C, A:A, ">="&DATE(2024,1,1), A:A, "<"&DATE(2024,2,1))

Averaging Within a Period

The same date-range pattern works with AVERAGEIFS. To find the average order value within a window, give the amount column as the average_range and add the two date conditions on the date column.

Remember the empty-period trap: if no orders fall inside the dates, AVERAGEIFS returns #DIV/0!. Wrapping it in IFERROR keeps a time-filtered dashboard tidy when a period has no data.

=IFERROR(AVERAGEIFS(C:C, A:A, ">="&F1, A:A, "<="&F2), "No data")

Quick Check

Recall the robust way to compare against a date in criteria functions.

Recap: Date Ranges in Criteria Functions

You can now filter SUMIFS, COUNTIFS, and AVERAGEIFS by time:

  • A date range is two conditions on the same date column (>= start and <= end).
  • Build dates with DATE(y,m,d) and attach operators using ">="&.
  • For months, use a next-day strict upper bound ("<"&DATE(...)) to handle timestamps.
  • Use TODAY() for rolling windows like the last 30 days.

That completes the multi-criteria IFS family.

=SUMIFS(C:C, B:B, F3, A:A, ">="&F1, A:A, "<"&F2)

Frequently asked questions

Is the “Date Ranges in Criteria Functions” lesson free?

Yes — the full text of “Date Ranges in Criteria Functions” is free to read here on the web, and the Excel Formulas Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Excel Formulas Academy course, upgrade to CoddyKit PRO.

What will I learn in “Date Ranges in Criteria Functions”?

Use between-dates logic to sum or count within a period. You practise Excel Formulas Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Excel Formulas Academy?

No prior experience is required. Excel Formulas Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Date Ranges in Criteria Functions” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Excel Formulas Academy lesson?

Yes. Every Excel Formulas Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Summing Across Conditions With SUMIFS
  2. Counting Across Conditions With COUNTIFS
  3. Averaging Across Conditions With AVERAGEIFS
  4. Date Ranges in Criteria Functions
← Back to Excel Formulas Academy