How to Count Holidays Between Two Dates in Excel

Learn multiple Excel methods to count holidays between two dates with step-by-step examples and practical applications.

excelformulaspreadsheettutorial
12 min read • Last updated: 7/2/2025

How to Count Holidays Between Two Dates in Excel

Why This Task Matters in Excel

Managing time accurately is central to almost every professional workflow—payroll teams need to know how many statutory holidays fall within a pay period, project managers must account for public holidays when building realistic timelines, and finance teams frequently adjust accruals or interest calculations based on the number of non-working days between two dates. Because holidays do not occur at perfectly regular intervals and can vary by country, region, or company policy, manually counting them is tedious and error-prone. Excel gives us repeatable, auditable tools to automate this counting, ensuring every internal report, client invoice, or project schedule is both timely and accurate.

Picture a consulting firm preparing a contract that spans several months. Professional-services hours cannot be billed on recognized holidays, so the firm must remove those days from their projected work calendar. HR departments often need similar counts when determining vacation balances or calculating end-of-year “use it or lose it” days. In manufacturing, production planners must factor national shutdown days into procurement lead-time calculations to prevent stock-outs. Across these scenarios, one miscount can cascade into schedule slips, incorrect payroll, or financial misstatements.

Excel is well suited to this task because it can unify calendars from multiple jurisdictions, apply them consistently, and update them instantly whenever holiday rules change. Functions like COUNTIFS, SUMPRODUCT, and NETWORKDAYS.INTL (with its holiday argument) let you tailor calculations to any calendar without resorting to VBA. Ignoring these tools forces teams to maintain error-prone manual tallies and reconciliations, draining productivity and introducing avoidable risk. Mastering holiday-count techniques also deepens your understanding of date serial numbers, dynamic ranges, and logical filtering—skills that expand naturally to broader Excel analytics such as resource capacity modeling and Monte Carlo scheduling simulations.

Best Excel Approach

The single most flexible formula for simply counting how many listed holidays fall between two arbitrary dates is the dual-condition COUNTIFS method. It is transparent, works in all modern Excel versions (Excel 2007+), and handles any custom holiday list—federal, regional, religious, or corporate.

Syntax (using a named range called Holidays for clarity):

=COUNTIFS(Holidays,">="&StartDate, Holidays,"<="&EndDate)

Why this is usually best:

  • It counts only rows explicitly designated as holidays, so you do not mistakenly treat weekends or other non-working days as holidays.
  • You can store multiple year calendars in one column, allowing long-range queries without extra formulas.
  • It respects dynamic date inputs—form controls, drop-downs, or formula-generated dates—making dashboards easy to refresh.

When to use alternatives:

  • If you need to exclude holidays from a business-day count rather than tally them, a WORKDAY or NETWORKDAYS approach is faster.
  • If holidays are stored across several sheets or formats, Power Query or SUMPRODUCT may provide better consolidation.

Prerequisites and setup:

  1. A definitive holiday list in date format (one date per row).
  2. StartDate and EndDate cells that contain valid dates or formulas returning dates.
  3. Named ranges (optional) for readability.

Logic overview: COUNTIFS applies two simultaneous filters—dates on or after StartDate and on or before EndDate—and then counts matching rows.

Alternative at a glance

NETWORKDAYS.INTL can also return holiday counts indirectly by subtracting the total business-day count from the total days between the dates, but that requires extra steps. We will explore it later; for raw holiday tallies, COUNTIFS remains the most direct.

Parameters and Inputs

To use any holiday count formula reliably, focus on five critical inputs:

  1. Holiday list
  • Data type: Date serial numbers.
  • Layout: Single column or a contiguous range (e.g., [H2:H100]).
  • Validation: No blanks, no textual month names—ensure every cell is a true date using Data Validation → Date.
  1. StartDate
  • Typically a single cell such as [B2].
  • Accepts hard-coded dates, cell references, or results of formulas like `=TODAY(`).
  1. EndDate
  • Same rules as StartDate.
  • EndDate must be on or after StartDate; build input validation or IF logic to trap reversed dates.
  1. Optional Named Range (Holidays)
  • Streamlines formulas and reduces errors when copying.
  • Create via Formulas → Name Manager → New → Refers to =Sheet1!$H$2:$H$100.
  1. Comparison operators
  • MUST be inside quotes in COUNTIFS and concatenated with an ampersand (&) when you compare to a cell value:
  • \">= \"&A2 is incorrect; always write \">=\"&A2.
  • Use ≤ and ≥ symbols in text explanations; operators stay intact in formulas.

Edge-case handling:

  • Duplicate holiday entries double-count—deduplicate via Remove Duplicates or UNIQUE if on Microsoft 365.
  • If the holiday list contains dates outside your analysis range (e.g., years 2025-2026 but you are counting 2023), that\'s fine; COUNTIFS ignores non-matching rows.
  • Mixed date and text will cause COUNTIFS to skip text silently, potentially under-counting. Use ISNUMBER or column formatting to clean data.

Step-by-Step Examples

Example 1: Basic Scenario

Imagine a small company that observes only U.S. federal holidays. You maintain a holiday list in [H2:H12] for the year 2024:

  • 2024-01-01
  • 2024-01-15
  • 2024-02-19
  • 2024-05-27
  • 2024-06-19
  • 2024-07-04
  • 2024-09-02
  • 2024-10-14
  • 2024-11-11
  • 2024-11-28
  • 2024-12-25

Step-by-step:

  1. Enter StartDate in [B2] (e.g., 2024-01-01) and EndDate in [C2] (e.g., 2024-06-30).
  2. Define the named range Holidays → selects [H2:H12].
  3. In [D2] (label “Holiday Count”), enter:
=COUNTIFS(Holidays,">="&B2, Holidays,"<="&C2)
  1. Press Enter. The result, 6, reflects six listed holidays from New Year’s Day through Juneteenth inclusive.

Why it works: COUNTIFS applies filter 1 (“dates on or after 2024-01-01”) and filter 2 (“dates on or before 2024-06-30”) then counts how many rows in Holidays satisfy both.

Variations:

  • Calculate for multiple periods by copying the formula down beside a schedule of pay periods—only StartDate/EndDate cells change row by row.
  • If you add Veterans Day observed on a different day (because Nov 11 falls on a weekend), just insert the date into the list and every COUNTIFS instantly updates.

Troubleshooting:

  • Incorrect count? Check that the Holiday column is formatted as Date, not Text.
  • Getting zero? Verify that StartDate and EndDate are actually dates (try formatting as Number; results like 45290 confirm a date serial).

Example 2: Real-World Application

Scenario: A global tech firm supports both U.S. and India offices. HR needs to count each country’s holidays within any travel overlap when employees work abroad. They keep two separate columns:

  • U.S. holidays [H2:H100]
  • India holidays [I2:I100]

Employee travel details reside in a table [tblTravel] with columns: Employee, Country, TripStart, TripEnd.

Objective: For each row, return how many holidays in the destination country occur during that trip, so payroll can exclude per-diem payments on those days.

Steps:

  1. Create two named ranges: US_Hol (range [H2:H100]) and IN_Hol (range [I2:I100]).
  2. In tblTravel, insert calculated column “HolidayCount” with the formula:
=IF([@Country]="USA",
     COUNTIFS(US_Hol,">="&[@TripStart], US_Hol,"<="&[@TripEnd]),
     COUNTIFS(IN_Hol,">="&[@TripStart], IN_Hol,"<="&[@TripEnd]))
  1. Excel evaluates the IF per row, directing the COUNTIFS to the correct holiday column.
  2. Copy the formula down or, if the table is structured, Excel fills it automatically.

Business impact: HR can budget travel allowances accurately even for overlapping regional holidays without manual cross-checking multiple calendars.

Integration: Connect tblTravel to Power Query or a Power BI model; the simple numeric HolidayCount becomes a key measure for dashboards.

Performance: Each COUNTIFS scans at most 365 rows per country per year—negligible overhead even with thousands of employees.

Example 3: Advanced Technique

Edge case: You keep a comprehensive master holiday table with columns Country, Region, HolidayDate, HolidayName spanning multiple years, maybe 10,000 rows. You want to create a flexible “Holiday Dashboard” where users pick a country from a drop-down, optionally pick a region, enter StartDate and EndDate, and instantly see how many holidays apply.

Setup:

  • [A2:A10000] Country
  • [B2:B10000] Region
  • [C2:C10000] HolidayDate
  • Define named ranges: HolidayCountry, HolidayRegion, HolidayDate.

User inputs:

  • Cell [F2] Country selection (Data Validation drop-down).
  • Cell [F3] Region selection (can be blank—meaning all regions).
  • Cell [F4] StartDate, [F5] EndDate.

Formula—dynamic multi-criterion approach using SUMPRODUCT (COUNTIFS cannot handle optional blank criteria elegantly in older Excel):

=SUMPRODUCT(
  --(HolidayDate>=F4),
  --(HolidayDate<=F5),
  --(HolidayCountry=F2),
  --( (F3="") + (HolidayRegion=F3) )
)

Explanation:

  • The double unary -- converts TRUE/FALSE to 1/0.
  • (F3="") + (HolidayRegion=F3) returns 1 when Region is blank (all regions) or when it matches.
  • SUMPRODUCT multiplies these logical arrays, effectively counting only rows that satisfy all active criteria.

Professional tips:

  • Convert the holiday table to an Excel Table and use structured references for readability.
  • Replace SUMPRODUCT with newer COUNTIFS plus nested IF or LET in Microsoft 365, but SUMPRODUCT remains a performant, version-agnostic choice.
  • For even larger datasets (hundreds of thousands of rows) consider loading the table into Power Pivot, defining a measure with DAX COUNTROWS and FILTER—still within Excel, still no VBA.

Tips and Best Practices

  1. Use Named Ranges or Tables: They make formulas self-documenting (Holidays vs $H$2:$H$100) and prevent broken references when lists grow.
  2. Maintain a Master Holiday Sheet: Centralize holiday data for the entire workbook. Downstream worksheets then reference one source of truth, simplifying updates.
  3. Validate Inputs: Apply Data Validation rules so EndDate must be ≥ StartDate. This blocks negative counts and user confusion.
  4. Dynamic Arrays for Modern Excel: If on Microsoft 365, UNIQUE and FILTER can build live holiday lists per country before counting, letting you store everything in one place.
  5. Conditional Formatting: Highlight holidays that fall inside the selected period by applying a formula rule—great visual confirmation your counts are correct.
  6. Document Assumptions: In a hidden notes sheet, record which holiday policy (e.g., federal vs state) the list follows. Colleagues will know when and why to update dates.

Common Mistakes to Avoid

  1. Mixing Textual Dates: Typing “July 4” without year or leaving cells as Text results in Excel treating them as plain strings. COUNTIFS then ignores them, leading to undercounts. Always enter full dates or use DATE(year,month,day).
  2. Duplicate Holiday Entries: Copy-pasting new calendars often replicates existing rows. COUNTIFS happily counts both, overstating totals. Deduplicate via Data → Remove Duplicates or the UNIQUE function.
  3. Reversed Start and End Dates: Users sometimes input 2024-12-31 as StartDate and 2024-01-01 as EndDate. Build an IF swap or alert message; otherwise COUNTIFS returns zero.
  4. Inconsistent Regional Filters: When filtering by region, forgetting to include blank-region logic can exclude events like nationwide holidays. Always accommodate “all regions” if that makes sense.
  5. Editing Named Ranges Manually: Expanding the holiday list past row 100 but forgetting to resize Holidays causes new dates to be missed. Convert lists to Excel Tables, which auto-expand, or redefine Names with dynamic offsets.

Alternative Methods

Below is a concise comparison of the main options for counting holidays.

MethodFormula ExampleProsConsBest Use Case
COUNTIFS`=COUNTIFS(`Holidays,\">=\"&B2, Holidays,\"<=\"&C2)Simple, fast, transparent, works in all modern versionsTwo criteria only; harder to add optional filtersQuick counts from a single list
SUMPRODUCTsee Example 3Handles optional criteria, works pre-2007, can reference arrays flexiblySlightly less readable; may slow down huge sheetsMulti-criterion, dynamic dashboards
FILTER+COUNTA (Microsoft 365)`=COUNTA(`FILTER(Holidays,(Holidays>=B2)*(Holidays<=C2)))Dynamic spill arrays, no ampersand operatorsRequires Microsoft 365; not backwards compatibleModern workbooks aimed at 365 users
Power Querym code customNo formulas to maintain, transforms disparate lists easilyRefresh needed; learning curvePeriodic reporting where refresh is fine
VBA UDFFunction CountHolidays(StartDate, EndDate)Unlimited logic, can access external calendarsMacro security, maintenance overheadSpecialized solutions distributed organisation-wide

Performance notes: For lists under a few thousand rows, differences are negligible. On 100k-row holiday datasets, COUNTIFS and SUMPRODUCT may lag—Power Query or DAX in Power Pivot scale better.

Migration strategy: Start with COUNTIFS. If you later need optional filters or larger data, encapsulate logic in SUMPRODUCT or move to Power Query; formulas remain conceptually similar so the transition is smooth.

FAQ

When should I use this approach?

Use direct COUNTIFS whenever you simply need a tally of listed holidays between two entered dates and your holiday list sits in one contiguous column. It is perfect for year-end payroll cut-offs, short project timelines, or any scenario where holidays are centrally stored.

Can this work across multiple sheets?

Yes. Reference the holiday list using a sheet-qualified name, e.g.,

=COUNTIFS('Holiday Calendar'!$A:$A,">="&B2,'Holiday Calendar'!$A:$A,"<="&C2)

Alternatively, define the named range Holidays to refer to the other sheet; formulas on any sheet can then call it directly.

What are the limitations?

COUNTIFS requires both StartDate and EndDate to be scalar values; it cannot evaluate array pairs out of the box. It also cannot apply OR logic unless you split formulas or move to SUMPRODUCT/FILTER. Very large datasets (hundreds of thousands of rows) may compute slowly.

How do I handle errors?

If users occasionally leave start or end cells blank, wrap the formula in IFERROR or IF checks:

=IF(OR(StartDate="",EndDate=""),"", COUNTIFS(Holidays,">="&StartDate,Holidays,"<="&EndDate))

This returns a blank rather than zero or #VALUE!

Does this work in older Excel versions?

COUNTIFS is available from Excel 2007 onward. Pre-2007 users should use SUMPRODUCT or array-entered COUNT(IF(...)). Note: NETWORKDAYS is available from 2003, but it counts business days rather than holidays specifically.

What about performance with large datasets?

Limit the referenced range to the actual data rather than entire columns, or convert the list to a Table that automatically sizes the range. Disable automatic calculation if you are performing bulk updates, or move the holiday table into Power Pivot where DAX can handle millions of rows efficiently.

Conclusion

Counting holidays between two dates is a foundational scheduling skill that ripples through payroll accuracy, project management realism, and financial forecasting integrity. By mastering COUNTIFS and its more advanced cousins, you transform a mundane manual task into an automated, audit-ready process aligned with the rest of your Excel toolbox. Build a robust holiday calendar, adopt dynamic named ranges or Tables, and you will never again second-guess whether a critical deadline collides with Independence Day or Diwali. Continue experimenting with SUMPRODUCT or FILTER to future-proof your workbooks, and you will be ready for any regional calendar your organisation needs to manage. Happy calculating!

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.