ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. COUNTIFS With a Date Range in Excel

COUNTIFS With a Date Range in Excel

By ExcelReady Team·Updated November 2, 2026·5 min read

The short answer

To count dates in a range, use COUNTIFS with two conditions on the same date column: =COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&F2), where F1 is the start date and F2 is the end date. The operators go in quotes, joined to the date with &. Add more range and criteria pairs to count by region or status too.

Key takeaways

  • A date range needs two conditions on the same column: ">="&start and "<="&end.
  • Join the operator to a cell or DATE() with &. Writing ">=F1" inside the quotes counts nothing.
  • Use DATE(2026,3,1) instead of typing a date as text, so the formula works with any regional setting.
  • If dates include times, use "<" and the day after the end date, so the last day counts in full.
  • EOMONTH(start,0) gives the last day of the month, which makes whole-month counts easy.
On this page+
  1. How COUNTIFS counts a date range
  2. Count dates between two dates with DATE
  3. Use cells for the start and end dates
  4. Count a whole month with EOMONTH
  5. Add more conditions: date range plus region
  6. Dates with times, open-ended ranges and rolling periods
  7. Why your COUNTIFS date range returns 0 or the wrong count
  8. Practise it

To use COUNTIFS with a date range, check the same date column twice: once for dates on or after the start, and once for dates on or before the end. The formula is =COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&F2), and it counts every row whose date falls between the two, including both ends. This guide shows the pattern on a small order list, then adds months, extra conditions and dates with times.

How COUNTIFS counts a date range#

Excel stores every date as a whole number, counting days from 1 January 1900. So "dates between 1 March and 31 March" is really "numbers between two values", and COUNTIFS can check that with two conditions on one column.

Excel formula
=COUNTIFS(date_range, ">="&start_date, date_range, "<="&end_date)

A row is counted only when both conditions are true. The COUNTIFS function guide covers the general syntax. All the examples below use this order list in A1:C9:

ABC
1OrderDateRegion
2A-10126 Feb 2026North
3A-1022 Mar 2026South
4A-1039 Mar 2026North
5A-10415 Mar 2026East
6A-10522 Mar 2026North
7A-10631 Mar 2026South
8A-1071 Apr 2026North
9A-10812 Apr 2026East

Count dates between two dates with DATE#

To put the dates straight into the formula, build them with DATE(year, month, day). This counts the March orders:

Excel formula
=COUNTIFS(B2:B9,">="&DATE(2026,3,1),B2:B9,"<="&DATE(2026,3,31))

The result is 5 (A-102 to A-106). The 26 February and April orders fail one of the two conditions.

Two details make this work. The operator ">=" sits inside quotes, and & joins it to the date. And DATE always means the same day, whatever the computer's date settings are. Typing ">=3/1/2026" can mean 1 March on one computer and 3 January on another.

Use cells for the start and end dates#

Put the dates in cells when you want to change the range without editing the formula. Type the start date in F1 (1 Mar 2026) and the end date in F2 (31 Mar 2026), then:

Excel formula
=COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&F2)

The result is again 5. Change F1 to 10 Mar 2026 and F2 to 5 Apr 2026, and it updates to 4 (15, 22 and 31 March, and 1 April).

Keep the cell reference outside the quotes. ">=F1" compares the dates with the letters F and 1, so it counts nothing and returns 0.

Count a whole month with EOMONTH#

For a monthly count, you only need the first day of the month. EOMONTH(start, 0) returns the last day of the same month, so you don't need to remember whether a month has 28, 30 or 31 days.

Excel formula
=COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&EOMONTH(F1,0))

With 1 Mar 2026 in F1, this returns 5. To build a monthly summary, list the first day of each month in a column (1 Feb, 1 Mar, 1 Apr) and fill the formula down with the month cell as the start. You get 1, 5 and 2. Lock the date range with dollar signs first, as $B$2:$B$9.

For a single day rather than a range, see how to count a specific date with COUNTIF.

Add more conditions: date range plus region#

COUNTIFS accepts more range and criteria pairs, so you can add a region, status or name to the date range. To count North orders in March:

Excel formula
=COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&F2,C2:C9,"North")

The result is 2 (A-103 and A-105). The North orders on 26 February and 1 April fall outside the dates. The guide to COUNTIFS and SUMIFS with multiple conditions shows how to build a full grid of counts by region and month.

To add up an amount column for the same dates instead of counting rows, swap COUNTIFS for SUMIFS and put the amount range first. See how to sum by date range.

Dates with times, open-ended ranges and rolling periods#

Real data often needs a slightly different version of the pattern.

  • Dates with times. A value like 31 Mar 2026 14:30 is bigger than 31 Mar 2026 (which means midnight), so "<="&DATE(2026,3,31) leaves it out. Use "less than the next day" instead: "<"&DATE(2026,4,1).
  • Before or after one date. Use a single condition. =COUNTIFS(B2:B9,"<"&DATE(2026,3,1)) returns 1, the February order.
  • The last 30 days. Use TODAY: =COUNTIFS(B2:B9,">="&TODAY()-30,B2:B9,"<="&TODAY()). The count changes every day.
  • One month across several years. COUNTIFS can't test the month alone. Use =SUMPRODUCT(--(MONTH(B2:B9)=3)) to count every March in the list. The comparison of COUNTIFS vs SUMPRODUCT explains when that's worth it.

Why your COUNTIFS date range returns 0 or the wrong count#

Most wrong counts come from the data, not the formula. Check these in order:

  1. Dates stored as text. Imported dates often sit on the left of the cell and are skipped by COUNTIFS. Test with =ISNUMBER(B2). FALSE means text; convert the column with DATEVALUE or Data > Text to Columns.
  2. The cell reference inside the quotes. Write ">="&F1, not ">=F1".
  3. Start and end the wrong way round. If F1 is later than F2, no date can pass both conditions.
  4. Times in the data. The last day is missed. Use "<" with the next day.
  5. The wrong year. DATE(2025,3,1) against 2026 data returns 0.

If you only need one condition, COUNTIF is enough; the article on COUNTIF vs COUNTIFS compares the two.

Practise it#

Date criteria are a favourite in Excel tests because the & is easy to forget. Practise dates in criteria in a live spreadsheet: you count and total rows between two dates, build a monthly summary and drive the range from input cells, with every formula checked instantly. Then practise more pairs in the COUNTIFS and SUMIFS lesson. Start with the March count in the exercise on this page.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

How many orders were placed in March 2026? The start date is in F1 and the end date in F2. In F4, use COUNTIFS on the Date column (B2:B9) with ">="&F1 and "<="&F2.

fx
ABCDEFG
1
Order
Date
Region
Start
46082
2
A-101
46079
North
End
46112
3
A-102
46083
South
4
A-103
46090
North
Orders
5
A-104
46096
East
6
A-105
46103
North
7
A-106
46112
South
8
A-107
46113
North
9
A-108
46124
East
10
11
12

Tip: Use the Date column twice: once with ">="&F1 and once with "<="&F2. Keep the operators in quotes and join the cells with &.

Practise this in a lesson

LessonDates in criteria: totals by date range and monthCount and total rows between two dates with COUNTIFS and SUMIFS, build a monthly summary, and drive the date range from input cells.LessonCOUNTIFS and SUMIFSCount and sum with several conditions at once, and learn why SUMIFS puts the sum range first.Function guideCOUNTIFSCount rows that meet several conditions with COUNTIFS. Examples for text, number ranges and between-values, plus a live exercise.

Frequently asked questions

How do I count dates between two dates in Excel?

+

Use COUNTIFS with the date column twice: =COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&F2). F1 holds the start date and F2 the end date. Both dates are included in the count.

Can COUNTIF count a date range?

+

Not in one function, because COUNTIF takes only one condition. You can subtract two COUNTIFs, but COUNTIFS with two conditions on the same column is simpler and easier to read.

How do I count dates in a specific month?

+

Put the first day of the month in a cell, such as F1, and use =COUNTIFS(B2:B9,">="&F1,B2:B9,"<="&EOMONTH(F1,0)). EOMONTH returns the last day of that month.

Why does my COUNTIFS date range return 0?

+

Common causes are dates stored as text, a cell reference written inside the quotes, the start and end dates the wrong way round, or a date range that misses the data's year.

How do I count dates in the last 30 days?

+

Use TODAY in the criteria: =COUNTIFS(B2:B9,">="&TODAY()-30,B2:B9,"<="&TODAY()). The result updates every day.

Sources

  • COUNTIFS function - Microsoft Support
  • DATE function - Microsoft Support
  • EOMONTH function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 2, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How COUNTIFS counts a date range
  2. Count dates between two dates with DATE
  3. Use cells for the start and end dates
  4. Count a whole month with EOMONTH
  5. Add more conditions: date range plus region
  6. Dates with times, open-ended ranges and rolling periods
  7. Why your COUNTIFS date range returns 0 or the wrong count
  8. Practise it

Keep reading

Conditional math· 7 min read

Sum by Date Range or Month in Excel With SUMIFS

To sum between two dates, give SUMIFS the same date column twice: once with ">="&start and once with "<"&end. For January 2025, write =SUMIFS(D2:D9,A2:A9,">="&DATE(2025,1,1),A2:A9,"<"&DATE(2025,2,1)). Keep the operator in quotes and join the date with &. Using "before the 1st of next month" works for every month.

Conditional math· 6 min read

COUNTIF With Dates: Before, After and Between

To count dates in Excel, join an operator to a date built with DATE: =COUNTIF(B2:B8,">="&DATE(2024,3,1)) counts dates on or after 1 March 2024. Use "<" for before. To count between two dates, use COUNTIFS with two conditions: =COUNTIFS(B2:B8,">="&DATE(2024,3,1),B2:B8,"<="&DATE(2024,3,31)). Build dates with DATE rather than typing them as text, which depends on regional settings.

Conditional math· 7 min read

COUNTIFS and SUMIFS: Multiple Conditions in Excel

COUNTIFS counts rows that meet several conditions, and SUMIFS adds numbers from those rows. Each condition is a pair: a range, then its criteria. A row counts only if it matches every pair. SUMIFS puts the sum range first: =SUMIFS(E2:E9,A2:A9,"North",C2:C9,"Laptop") totals North laptop revenue.

More on conditional math

  • MAXIFS and MINIFS: Highest and Lowest With Conditions
  • MINIFS in Excel: Find the Smallest Value That Matches
  • How to Sum by Category in Excel
  • How to Sum by Month in Excel With SUMIFS
  • How to Sum by Quarter in Excel
  • How to Sum by Week in Excel
All conditional math articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free