Count Holidays Between Two Dates in Excel
In this article
To count holidays between two dates in Excel, use the COUNTIFS function with a range of holiday dates and the two date cells as criteria. For example, =COUNTIFS(holidays, ">="&A2, holidays, "<="&B2) returns the number of holidays falling within the dates in A2 and B2.
Formula
The general formula is:
=COUNTIFS(holiday_range, ">="&start_date, holiday_range, "<="&end_date)
- holiday_range: the range of cells containing the holiday dates (e.g.,
D2:D20). - start_date: a cell reference or date value for the beginning of the period.
- end_date: a cell reference or date value for the end of the period.
The COUNTIFS function counts cells that meet all specified criteria. Here, it checks each date in the holiday range to see if it is greater than or equal to the start date and less than or equal to the end date. The ampersand (&) concatenates the comparison operator with the date value, so Excel treats the date as a number rather than text.
Worked Example
Suppose you have a list of holidays in cells D2:D10:
D2: 2025-01-01 D3: 2025-01-20 D4: 2025-02-17 D5: 2025-05-26 D6: 2025-07-04 D7: 2025-09-01 D8: 2025-10-13 D9: 2025-11-11 D10: 2025-12-25
You want to count holidays between January 1, 2025, and June 30, 2025. Put the start date in cell A2 (2025-01-01) and the end date in cell B2 (2025-06-30). The formula:
=COUNTIFS(D2:D10, ">="&A2, D2:D10, "<="&B2)
Excel evaluates each date in the range:
- 2025-01-01 is ≥ start and ≤ end → count 1
- 2025-01-20 → count 2
- 2025-02-17 → count 3
- 2025-05-26 → count 4
- 2025-07-04 is > end → not counted
- 2025-09-01 → not counted
- 2025-10-13 → not counted
- 2025-11-11 → not counted
- 2025-12-25 → not counted
The result is 4.
Using a Table for Holidays
If your holiday list is in an Excel table, you can use structured references to make the formula more readable. For example, if the table is named HolidayTable and the date column is named Date, the formula becomes:
This works the same way but automatically adjusts when you add or remove rows from the table.
Counting Weekends or Specific Weekdays
Sometimes you may want to count holidays that fall on a weekend or a specific weekday. You can combine COUNTIFS with the WEEKDAY function. For instance, to count holidays that occur on a Saturday (weekday 7) or Sunday (weekday 1) within the date range:
=SUMPRODUCT((holiday_range >= start)*(holiday_range <= end)*(WEEKDAY(holiday_range,2)>=6))
Here, WEEKDAY(date,2) returns 1 for Monday through 7 for Sunday. The SUMPRODUCT multiplies the three conditions and sums the results, effectively counting rows where all are true.
Common Mistakes and Issues
- Using
COUNTIFinstead ofCOUNTIFS:COUNTIFcan only handle one condition. For two dates, you needCOUNTIFS. - Forgetting the ampersand: Writing
">="A2instead of">="&A2treats the date as text and returns zero. - Date format inconsistencies: If your holiday list contains text that looks like dates, Excel may not recognize them. Ensure all dates are actual date values, not strings.
- Inclusive vs exclusive: The formula above includes the start and end dates. If you want to exclude them, use
>and<instead. - Blank cells: If the holiday range includes blank cells,
COUNTIFSignores them, so no issue.
Alternatives: SUMPRODUCT and Dynamic Arrays
For older Excel versions without COUNTIFS, you can use SUMPRODUCT:
=SUMPRODUCT((holiday_range >= start)*(holiday_range <= end))
In Excel 365, you can also use the FILTER function to list the holidays and then count them:
=ROWS(FILTER(holiday_range, (holiday_range >= start)*(holiday_range <= end)))
This returns the number of rows after filtering, which is equivalent to the count.
Frequently Asked Questions
How do I count holidays including the start and end dates?
The formula =COUNTIFS(holidays, ">="&A2, holidays, "<="&B2) includes both dates. If you want to exclude them, change >= to > and <= to <.
Can I count holidays that fall on weekends?
Yes, combine COUNTIFS with WEEKDAY using SUMPRODUCT as shown above. For example, to count holidays on Saturdays or Sundays: =SUMPRODUCT((holidays>=start)*(holidays<=end)*(WEEKDAY(holidays,2)>5)).
What if my holiday list is on another sheet?
Reference the other sheet in the formula, e.g., =COUNTIFS(Sheet2!$D$2:$D$10, ">="&A2, Sheet2!$D$2:$D$10, "<="&B2). Ensure the sheet name is followed by an exclamation mark.
Why does my formula return 0 even though there are holidays in the range?
Check that the dates in the holiday list are actual date values, not text. Also verify that the start and end cells are formatted as dates. Use the ISNUMBER function on a holiday cell to confirm it's numeric.
Can I count holidays in a dynamic range that updates automatically?
Yes, use an Excel table or a named range that expands, or use a dynamic array formula like =SUM((holidays>=start)*(holidays<=end)) in Excel 365, which spills automatically.