Last verified · v1.0
Calculator · business
Working Days Calculator
Count business days between any two dates, excluding weekends and US federal or state holidays. Accurate results for payroll, legal, and project deadlines.
Inputs
Working Days
—
Explain my result
Get a plain-English breakdown of your result with practical next steps.
The formula
How the
result is
computed.
How the Working Days Calculator Works
The working days calculator determines the exact number of business days between two dates by applying a precise three-phase mathematical formula. This tool is essential for payroll processing, contract deadline management, project sprint planning, and regulatory compliance windows where calendar days and working days produce materially different results.
The Core Formula
The calculator applies the following formula: W = ⌊D ÷ 7⌋ × 5 + Σ(i=0 to R−1) 𝟙[(s+i) mod 7 ∉ {5,6}] − Hstate
Each variable represents a specific element of the date range:
- W — Total working days in the period
- D — Total calendar days between the start and end dates (inclusive of the start day)
- ⌊D ÷ 7⌋ — Number of complete weeks via floor division, each contributing exactly 5 working days
- R — Remainder days after complete weeks are extracted (R = D mod 7)
- s — Numeric day of the week the period begins (0 = Monday through 6 = Sunday)
- 𝟙[...] — Indicator function: returns 1 for weekdays (mod values 0–4), returns 0 for Saturday (5) or Sunday (6)
- Hstate — Count of public holidays falling on weekdays within the period, determined by the selected US state
Step-by-Step Formula Derivation
Phase 1 — Complete-week contribution: Every full 7-day block always contains exactly 5 working days and 2 weekend days. Applying floor division ⌊D ÷ 7⌋ and multiplying by 5 computes this portion in constant time without iterating through individual days, making the approach computationally efficient for any date range.
Phase 2 — Remainder days: The leftover R days (R = D mod 7), beginning from weekday index s, are evaluated individually using the indicator function. A day whose modular index equals 5 or 6 contributes zero to the sum; all others contribute 1. Summing these indicators yields the working-day count within the partial week at the end of the range.
Phase 3 — Holiday deduction: The term Hstate subtracts all federally and state-observed holidays that land on weekdays within the date range. The U.S. Office of Personnel Management maintains the official schedule of 11 annual federal holidays. States independently designate additional observances, so Hstate varies by jurisdiction and can significantly change the final working-day count.
Worked Example: 20-Day Project Window
Consider a project running from Monday, January 6 to Friday, January 24 — a span of 20 calendar days with s = 0 (Monday):
- Complete weeks: ⌊20 ÷ 7⌋ = 2 → 2 × 5 = 10 working days
- Remainder: 20 mod 7 = 6 days from Monday → Mon, Tue, Wed, Thu, Fri, Sat → 5 working days
- Subtotal: 10 + 5 = 15 working days
- Holiday deduction: Martin Luther King Jr. Day falls on January 20 (Monday) → Hstate = 1
- Final result: W = 15 − 1 = 14 working days
State-Level Holiday Variation
Holiday counts differ substantially across US states. The federal government mandates 11 public holidays per year, but states add further observances independently. Texas law authorizes up to 20 state holidays annually, while many northeastern states observe between 11 and 15. The New York State Comptroller's Office publishes detailed days-worked calculation standards for public employees — a methodology this calculator mirrors for accuracy. Holiday pay standards from UC Davis Finance and Business further inform how observed vs. actual holiday dates are treated when a holiday falls on a weekend and is shifted to a nearby weekday.
Practical Applications
- Payroll and HR: Prorate salaries accurately, track leave balances, and calculate overtime eligibility based on exact weekday counts within a pay period.
- Legal and regulatory deadlines: Courts, agencies, and contracts routinely measure filing windows and notice periods in business days; a one-day miscalculation can invalidate a submission or trigger a breach.
- Project management: Sprint planning and Gantt chart construction depend on accurate business-day counts to assign realistic task durations and delivery milestones.
- Contract terms: Net-30, Net-60 payment clauses, cure periods, and termination notice requirements frequently specify working days rather than calendar days.
- Supply chain logistics: Vendor lead times quoted in business days must be converted precisely to calendar dates to schedule procurement and avoid stockouts.
Reference