Date formula page
Workdays Between Dates Formula
Use NETWORKDAYS when weekends and optional holidays should be excluded from the day count.
Count workdays between dates in Excel or Google Sheets.
The formula counts weekdays from A2 through B2, excluding holidays listed in H2:H10.
Copy formulas
=NETWORKDAYS(A2, B2, H2:H10)=NETWORKDAYS(A2, B2, H2:H10)Excel and Google Sheets use NETWORKDAYS to count inclusive weekdays between two dates. The optional holiday range removes listed dates from that count.
Example data
| Start Date | End Date | Holiday | Result |
|---|---|---|---|
| 2026-01-01 | 2026-01-31 | 2026-01-19 | 30 |
| 2026-02-10 | 2026-03-12 | 30 | |
| 1990-05-20 | 2026-05-20 | 36 |
The formula counts weekdays from A2 through B2, excluding holidays listed in H2:H10.
How the formula works
- A2 is the start date.
- B2 is the end date.
- H2:H10 is an optional holiday list.
| Syntax piece | Role in the formula |
|---|---|
| A2 | The inclusive start date. |
| B2 | The inclusive end date. |
| H2:H10 | An optional range of real holiday dates excluded from the workday count. |
Verified examples
=NETWORKDAYS(A2,B2)Excel: Set A2 to 2026-01-05 and B2 to 2026-01-09; leave holidays empty. Returns: 5
=NETWORKDAYS(A2, B2, H2:H10)Google Sheets: Use the same dates and put 2026-01-07 in H2. Returns: 4
=NETWORKDAYS(A2,B2)Excel: Set A2 to 2026-01-09 and B2 to 2026-01-05 with no holidays. Returns: -5
Common errors and fixes
| Issue | Likely cause | Fix |
|---|---|---|
| NETWORKDAYS returns #VALUE! | A2, B2, or a holiday cell contains text rather than a real date serial. | Convert all date inputs and holiday entries to real spreadsheet dates. |
| A listed holiday does not reduce the result | The holiday is stored as text, falls outside H2:H10, or includes an unexpected time value. | Use date-formatted holiday serials in the referenced range and include the complete holiday list. |
| The result uses the wrong weekend pattern | NETWORKDAYS assumes Saturday and Sunday are weekends. | Use NETWORKDAYS.INTL when the workweek has custom weekend days. |
When not to use this formula
- Do not use NETWORKDAYS when calendar days, rather than working days, should be counted.
Alternatives
| Alternative | When to use it |
|---|---|
| Days Between Dates Formula | Use when weekends and holidays should remain included. |
| Next Business Day Formula | Use when the required output is one future or previous workday, not a count. |
Related formulas
Official references
- NETWORKDAYS function from Microsoft
FAQ
Are the start and end dates included?
Yes. If an endpoint is a workday, NETWORKDAYS counts it; reversing the endpoints returns the negative count.
How can I use a custom weekend?
Use NETWORKDAYS.INTL and provide the weekend pattern required by the work schedule.