how to calculate weekdays between two dates excluding public holidays
The ability to calculate weekdays between two dates excluding public holidays is useful for payroll, project timelines, SLA computations and planning. This guide explains what the calculation means, the formula and step-by-step manual and spreadsheet methods, examples with numbers, how to use an online calculator, and how to interpret results.
what is the calculation and when to use it
Calculating weekdays between two dates excluding public holidays determines the number of working days (typically Monday–Friday) in a date range after removing specified holiday dates. Use it when you need accurate business-day counts for invoicing, deadlines, resource planning or legal timelines.
core idea and simple formula
At its simplest, the calculation can be expressed as:
Working days = Total weekdays in range − Number of holiday dates that fall on weekdays
Where "Total weekdays in range" counts Monday through Friday occurrences between two dates inclusive (or exclusive depending on your policy).
step-by-step manual method
- Decide whether you include both start and end dates. Common approach: include both if full days count (adjust if you need exclusive).
- Calculate total days between the two dates:
total_days = end_date − start_date + 1(if inclusive). - Compute how many full weeks are in that span and the remaining days:
full_weeks = floor(total_days / 7),extra_days = total_days % 7. - Total weekdays from full weeks:
weekdays_from_weeks = full_weeks * 5. - Handle the extra_days by checking the day of week for start_date and counting how many of those extra days are weekdays (Mon–Fri).
- Add weekdays_from_weeks + weekdays_from_extras = total_weekdays.
- Prepare a list of public holidays that fall within the date range. Count only those holidays that occur on weekdays. Subtract that count:
working_days = total_weekdays − weekday_holidays.
details for counting extra days
To count how many weekdays are in the leftover extra_days you must know the weekday number of the start date (for example: Monday=1, Sunday=7). Then iterate through the extra_days and count those whose weekday is between 1 and 5.
worked example 1 — short range
Calculate working days inclusive between Monday, March 1 and Friday, March 5. Assume no holidays.
- start_date = Mon Mar 1, end_date = Fri Mar 5
- total_days = 5 (inclusive)
- full_weeks = floor(5/7) = 0, extra_days = 5
- weekdays_from_weeks = 0
- start weekday = Monday → extra days Mon–Fri are all weekdays → weekdays_from_extras = 5
- total_weekdays = 5; no holidays → working_days = 5
worked example 2 — long range with holidays
Calculate working days inclusive from Wednesday, April 1 to Tuesday, April 21. Public holidays within that range: Friday April 10 and Monday April 13.
- start_date = Wed Apr 1, end_date = Tue Apr 21
- total_days = 21
- full_weeks = floor(21/7) = 3, extra_days = 0
- weekdays_from_weeks = 3 * 5 = 15
- extra days = 0 → weekdays_from_extras = 0
- total_weekdays = 15
- Holidays: Apr 10 (Friday) and Apr 13 (Monday) both fall on weekdays → weekday_holidays = 2
- working_days = 15 − 2 = 13
manual algorithm summary (pseudo-code)
function count_working_days(start_date, end_date, holiday_list): if end_date < start_date: swap dates total_days = days_between(start_date, end_date) + 1 # inclusive full_weeks = floor(total_days / 7) extra_days = total_days % 7 weekdays = full_weeks * 5 start_weekday = weekday_number(start_date) # 1=Mon .. 7=Sun for i from 0 to extra_days-1: day_of_week = (start_weekday + i - 1) % 7 + 1 if day_of_week between 1 and 5: weekdays += 1 weekday_holidays = count of holidays in holiday_list that are between start_date and end_date and whose weekday between 1 and 5 return weekdays - weekday_holidays
spreadsheet method (Excel / Google Sheets)
Use built-in functions for a quick result.
- Excel: WORKDAY.INTL(start_date, days, [weekend], [holidays]) and NETWORKDAYS(start_date, end_date, [holidays]).
- Google Sheets: NETWORKDAYS(start_date, end_date, [holidays]).
Example: =NETWORKDAYS(A2, B2, C2:C10) where A2 is start date, B2 is end date and C2:C10 lists holiday dates. NETWORKDAYS counts weekdays and automatically excludes listed holidays.
how to use an online calculator on Calculatorr
To calculate weekdays between two dates excluding holidays using an online tool:
- Navigate to the weekdays or business days calculator at https://calculatorr.com/ (search 'business days' or 'working days').
- Enter start and end dates and choose inclusive/exclusive option if available.
- Paste or upload the list of public holidays (one date per line) or select a country calendar if offered.
- Run the calculation — the tool returns the count of working days and often lists which dates are treated as holidays.
Using an online calculator removes manual errors and saves time when handling many holidays or long ranges.
interpretation of results
- Result is the number of business days available for work, billing, or deadlines between the two dates after removing holidays.
- If you use exclusive ranges (exclude start or end), adjust the input accordingly or subtract 1 from the inclusive result.
- For partial-day policies (half-days on holidays or special schedules), convert partial days into fractional counts before subtracting.
common pitfalls and how to avoid them
- Not deciding inclusive vs exclusive: always state whether both start and end are counted.
- Forgetting to exclude holidays that fall on weekends: only subtract holidays that are on weekdays.
- Using the wrong weekday numbering or locale: verify your weekday mapping (some systems start weeks on Sunday).
- Assuming the same holiday list applies universally: public holidays differ by country, region and year—use the correct calendar for your location.
- Leap years and DST do not affect counts of weekdays but ensure date arithmetic accounts for calendar norms.
advanced adjustments
For different workweeks (e.g., Sunday–Thursday) or regional weekend days, adjust the weekday definition in the algorithm. Replace the 'Mon–Fri' weekday range with the working-day set for your organization and count accordingly. Many spreadsheet functions accept a weekend pattern parameter to handle this.
quick checklist before applying the result
- Confirm inclusive or exclusive counting policy.
- Use the correct holiday list for the exact region and date range.
- Decide whether to treat partial days as fractional working days.
- For SLAs, add buffer days if processing capacity or approvals can delay outcomes.
If you need a fast calculation, try the working days and holiday-aware calculators at Calculatorr to get precise counts and downloadable lists of excluded dates.
examples table
| Start | End | Total days (incl.) | Weekdays | Weekday holidays | Working days |
|---|---|---|---|---|---|
| 2026-03-01 (Mon) | 2026-03-05 (Fri) | 5 | 5 | 0 | 5 |
| 2026-04-01 (Wed) | 2026-04-21 (Tue) | 21 | 15 | 2 | 13 |
| 2026-12-20 (Mon) | 2027-01-10 (Sun) | 22 | 14 | 3 | 11 |
Note: the table shows example date spans. Replace holiday lists with the precise dates that apply to your country or company.