Skip to main content
ExcelCount Holidays Between DatesDate & TimeHoliday CalculationFormula Arrays

The Problem

Are you staring at a calendar, manually tallying holidays between two dates, dreading every new project timeline or payroll cycle? It’s a common spreadsheet headache. Miscounting holidays can throw off project deadlines, lead to inaccurate payroll, or cause scheduling chaos. This manual process is not only tedious but also highly prone to human error, turning what should be a simple calculation into a time-consuming chore.

What is counting holidays between dates? Counting holidays between dates in Excel involves identifying and tallying specific non-working days that fall within a defined start and end date range. This process is commonly used to accurately calculate working days, adjust project timelines, or ensure correct payroll deductions for employee leave. Without an automated solution, you might find yourself repeatedly scanning holiday lists, leading to frustrating discrepancies.

Excel, thankfully, provides the tools to automate this. With the right formula, you can empower your spreadsheets to precisely count holidays between dates with speed and accuracy. This means less time on manual checks and more time focusing on critical tasks. Let's whip up a solution that makes your spreadsheets sing.

Business Context & Real-World Use Case

Imagine you're an HR manager tasked with processing employee leave requests, or a project manager setting realistic deadlines for a new initiative. Manually cross-referencing individual leave periods or project spans against a national or company-specific holiday calendar is an administrative nightmare. This process often involves juggling multiple documents and can introduce significant errors, leading to delays in payroll processing or missed project milestones.

Why is doing this manually a bad idea? Beyond the sheer inefficiency, manual holiday counting creates a high risk of inaccuracies. A single missed holiday could result in overpaying for leave, underestimating project duration, or miscalculating a financial accrual. The business value of automating this process is immense: it ensures compliance, improves financial accuracy, and significantly boosts operational efficiency. Automated holiday counting liberates valuable employee time, allowing your team to focus on strategic work rather than repetitive data entry.

In our experience consulting for a mid-sized manufacturing firm, their HR department used to spend an entire day each month manually cross-referencing employee leave dates against a national holiday calendar. This led to frequent payroll corrections, causing frustration for both staff and management. Implementing an automated solution to count holidays between dates not only saved them significant time but also boosted employee trust in payroll accuracy. It transformed a recurring pain point into a seamless, reliable process.

The Ingredients: Understanding COUNT()'s Setup

To expertly count holidays between dates in Excel, we'll combine the power of COUNT() with the versatility of FILTER(). While COUNT() by itself counts numbers in a range, FILTER() allows us to create a dynamic list of holidays that meet our criteria, which COUNT() then easily tallies. This combination is both elegant and robust.

The exact syntax for our recipe will be:

=COUNT(FILTER(Holiday_Range, (Holiday_Range>=StartDate_Cell)*(Holiday_Range<=EndDate_Cell)))

Let's break down each key component, like preparing your mise en place before cooking. Understanding these variables is crucial for a perfectly executed formula.

Variable Description
Holiday_Range The Excel range containing your complete list of holiday dates. This should be a column or row of valid Excel dates (e.g., D2:D100).
StartDate_Cell The cell containing the specific start date of your desired counting period. This must be a valid Excel date (e.g., A2).
EndDate_Cell The cell containing the specific end date of your desired counting period. This must be a valid Excel date (e.g., B2).

The FILTER() function dynamically creates an array of dates from Holiday_Range that satisfy both conditions: being greater than or equal to the StartDate_Cell AND less than or equal to the EndDate_Cell. COUNT() then simply counts the number of dates (which Excel stores as numbers) in this filtered array. This means we are effectively able to count holidays between dates using the COUNT function directly.

The Recipe: Step-by-Step Instructions

Let's put on our chef's hat and prepare a practical example. An HR team needs to determine how many official company holidays fall within a specific project's timeline, from January 15, 2026, to March 20, 2026. This will help them accurately plan resources and manage deadlines.

Here's our sample data setup:

A B C D
1 Start Date End Date Holiday Count Holiday List
2 2026-01-15 2026-03-20 2026-01-01
3 2026-01-19
4 2026-02-16
5 2026-03-17
6 2026-05-25
7 2026-07-04

Follow these steps to count holidays between dates:

  1. Prepare Your Data: First, input your Start Date in cell A2 (2026-01-15) and your End Date in cell B2 (2026-03-20). Next, list all your official holidays in column D, starting from D2 (e.g., D2:D7).

  2. Select Your Output Cell: Click on cell C2. This is where our calculated holiday count will appear.

  3. Start the Formula with COUNT(): Begin by typing =COUNT( into cell C2. This tells Excel you intend to count numerical values.

  4. Introduce the FILTER Function: Inside the COUNT function's parentheses, type FILTER(D2:D7,. Here, D2:D7 is our Holiday_Range.

  5. Define the Start Date Criterion: Now, add the first condition for filtering. We want holidays that are on or after our start date: (D2:D7>=A2)*. The asterisk * acts as an AND operator in array formulas, ensuring both conditions must be true.

  6. Define the End Date Criterion: Append the second condition to the FILTER function. We need holidays that are on or before our end date: (D2:D7<=B2)).

  7. Complete the Formula: Finally, close the parentheses for FILTER and then for COUNT. Your complete formula should now look like this:

    =COUNT(FILTER(D2:D7,(D2:D7>=A2)*(D2:D7<=B2)))
    
  8. Press Enter for the Result: Hit Enter. Excel will instantly calculate the holidays.

The result in cell C2 will be 3. This is because, within our specified period (Jan 15, 2026, to Mar 20, 2026), the holidays that fall are: 2026-01-19 (MLK Day), 2026-02-16 (Presidents' Day), and 2026-03-17 (St. Patrick's Day). The other holidays (Jan 1, May 25, July 4) fall outside this range and are therefore excluded by our FILTER criteria. This precise method makes it incredibly simple to count holidays between dates dynamically.

Pro Tips: Level Up Your Skills

Mastering the basics is just the beginning. Elevate your holiday counting capabilities with these expert tips, ensuring your spreadsheets are not just functional but also robust and user-friendly. Experienced Excel users often leverage these techniques for efficiency and clarity.

  • Name Your Ranges for Clarity: Instead of using cell references like D2:D7, define a named range (e.g., "CompanyHolidays", "ProjectStartDate", "ProjectEndDate"). This makes your formulas far more readable and less prone to errors when auditing or modifying. For instance, your formula could become =COUNT(FILTER(CompanyHolidays, (CompanyHolidays>=ProjectStartDate)*(CompanyHolidays<=ProjectEndDate))).
  • Use Caution When Scaling Arrays Over Massive Rows: While FILTER and COUNT are efficient, performing array calculations over tens of thousands or hundreds of thousands of rows can impact performance. For truly massive datasets, consider alternative approaches like Power Query or VBA, especially in older Excel versions. For typical business use cases, however, this COUNT method is highly performant.
  • Dynamic Holiday List Management: Link your holiday list to an external data source or a dedicated "Settings" sheet. This allows easy updates without digging into formulas. You can even use SORT and UNIQUE to ensure your holiday list is clean and free of duplicates before your COUNT formula processes it.
  • Exclude Weekends or Specific Days: If your definition of a holiday only applies to working days, you might need to combine this formula with NETWORKDAYS.INTL or add an extra criterion using WEEKDAY() within your FILTER function to exclude weekends from your holiday list itself. This makes your COUNT of holidays even more granular.

Troubleshooting: Common Errors & Fixes

Even the most seasoned Excel chefs occasionally run into unexpected issues. When your formula to count holidays between dates isn't behaving as expected, these common troubleshooting steps will help you diagnose and fix the problem.

1. #VALUE! Error with Dates

  • What it looks like: #VALUE! displayed prominently in your result cell. This is one of the most frequent and frustrating errors when working with dates.
  • Why it happens: Most commonly, this occurs when one of your date inputs (the start date, end date, or any entry within your Holiday_Range) is not recognized by Excel as a valid date. Excel stores dates as numerical values; text entries, even if they visually resemble dates (e.g., "Jan 1, 2026" typed directly as text), will cause calculation errors because they cannot be compared numerically. The FILTER function expects numerical dates for its criteria, and non-numerical values will trigger #VALUE!.
  • How to fix it:
    1. Check Date Formatting: Ensure all cells containing dates (A2, B2, and your Holiday_Range) are properly formatted as "Date" cells. Select the cells, right-click, choose "Format Cells," and select a Date category.
    2. Convert Text to Dates: If you suspect text dates, try selecting the problematic column, go to the "Data" tab, click "Text to Columns," choose "Delimited" (or "Fixed Width" if applicable), click "Next," and on "Step 3 of 3," select "Date" and choose the correct date format (e.g., MDY). This is often an instant fix for #VALUE! issues.
    3. Verify Valid Dates: Double-check that your dates are within Excel's supported date range (1/1/1900 to 12/31/9999). Dates outside this range will not be recognized.

2. Incorrect Holiday Count (Too Low or Too High)

  • What it looks like: The formula returns a number, but it's not the accurate count you're expecting based on your holiday list and date range.
  • Why it happens: This often points to issues with how your ranges are defined or the logic within your FILTER criteria.
    • Incorrect Holiday Range: Your Holiday_Range might not encompass all relevant holidays, or it could accidentally include non-date entries or empty cells at the end, leading to an undercount or unexpected behavior.
    • Date Criteria Mismatch: The >= and <= operators might be mistakenly flipped, or your StartDate_Cell and EndDate_Cell might inadvertently fall outside the intended period. Forgetting to make the range inclusive (>=, <=) when dates should be counted can also cause this.
    • Duplicate Holidays: Your holiday list might contain the same date multiple times, leading to an inflated count.
  • How to fix it:
    1. Review Ranges Carefully: Select the formula cell and press F2 to enter edit mode. Excel will highlight the ranges used. Visually confirm that Holiday_Range, StartDate_Cell, and EndDate_Cell are correctly pointing to your data. Adjust if necessary.
    2. Inspect Holiday Data: Manually examine your Holiday_Range for missing dates, additional non-date text, or duplicate entries. To find duplicates, select your Holiday_Range, go to "Home" tab, "Conditional Formatting," "Highlight Cells Rules," "Duplicate Values."
    3. Verify Date Logic: Double-check the logical conditions within FILTER: (Holiday_Range>=StartDate_Cell)*(Holiday_Range<=EndDate_Cell). Ensure these operators correctly reflect your requirement to count holidays between dates inclusively.

3. Spill Error (#SPILL!)

  • What it looks like: #SPILL! appears in your formula cell, often with a dotted border indicating where the results would have spilled.
  • Why it happens: The FILTER function is a dynamic array function that, when used on its own, will "spill" its results into adjacent empty cells. If those adjacent cells contain data or are merged, Excel cannot spill and throws a #SPILL! error. While COUNT(FILTER(...)) usually contains the spill within the COUNT function itself (because COUNT expects a single result), this error can occur if you've previously experimented with the FILTER part of the formula alone in a cell that now has obstructions, or if the Holiday_Range itself is a dynamic array that is already spilling into an obstructed area.
  • How to fix it:
    1. Clear Adjacent Cells: Select the cell with the #SPILL! error. If Excel indicates a spill range, clear all content from those cells.
    2. Unmerge Cells: Ensure no cells around your formula are merged, as merged cells prevent spilling.
    3. Review Source Arrays: If your Holiday_Range or date inputs are themselves the result of other dynamic array formulas, check those source formulas for #SPILL! errors that might be propagating. Address the root cause in the source array.

Quick Reference

This powerful recipe allows you to efficiently count holidays between dates for various analytical needs.

  • Syntax:
    =COUNT(FILTER(Holiday_Range, (Holiday_Range>=StartDate_Cell)*(Holiday_Range<=EndDate_Cell)))
    
  • Most Common Use Case: Precisely tallying specific non-working days within any user-defined date interval for improved scheduling, accurate payroll, or robust project management.

Related Functions

👨‍💻

Written by The Head Chef

Former 10-year Financial Analyst who survived countless month-end closes. I build these recipes to save you from weekend-ruining spreadsheet errors.

Read the full story →

You might also find these useful 💡