COUNTIFS With a Date Range in Excel
By ExcelReady TeamUpdated 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+
- How COUNTIFS counts a date range
- Count dates between two dates with DATE
- Use cells for the start and end dates
- Count a whole month with EOMONTH
- Add more conditions: date range plus region
- Dates with times, open-ended ranges and rolling periods
- Why your COUNTIFS date range returns 0 or the wrong count
- 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.
=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:
| A | B | C | |
|---|---|---|---|
| 1 | Order | Date | Region |
| 2 | A-101 | 26 Feb 2026 | North |
| 3 | A-102 | 2 Mar 2026 | South |
| 4 | A-103 | 9 Mar 2026 | North |
| 5 | A-104 | 15 Mar 2026 | East |
| 6 | A-105 | 22 Mar 2026 | North |
| 7 | A-106 | 31 Mar 2026 | South |
| 8 | A-107 | 1 Apr 2026 | North |
| 9 | A-108 | 12 Apr 2026 | East |
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:
=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:
=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.
=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:
=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:
- 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. - The cell reference inside the quotes. Write
">="&F1, not">=F1". - Start and end the wrong way round. If F1 is later than F2, no date can pass both conditions.
- Times in the data. The last day is missed. Use
"<"with the next day. - 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.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Region | ||||||
| 2 | North | ||||||
| 3 | South | ||||||
| 4 | North | Orders | |||||
| 5 | East | ||||||
| 6 | North | ||||||
| 7 | South | ||||||
| 8 | North | ||||||
| 9 | 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
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.