To count workdays between two dates in Excel, use =NETWORKDAYS(A2,B2), where A2 contains the start date and B2 contains the end date. Excel counts Monday through Friday and includes both dates when they are workdays; add a holiday range to exclude holidays.
The basic NETWORKDAYS formula
NETWORKDAYS is the standard choice when your workweek is Monday through Friday and Saturday and Sunday are nonworking days. It returns a whole-number count of working days in a date interval, rather than the elapsed number of calendar days. The function is available in current Excel versions, including Microsoft 365.
For a concrete example, suppose A2 contains January 6, 2025, a Monday, and B2 contains January 17, 2025, a Friday. With those dates in A2 and B2, the formula is =NETWORKDAYS(A2,B2). The result is 10: there are five weekdays in January 6–10 and five in January 13–17.
Enter the formula in another cell, such as C2, and press Enter. If you see a date instead of a count, the result cell may be formatted as a date. Change its format to General or Number using Home > Number Format. The formula itself still returns a count.
Why the result includes both dates
A common source of confusion is the word “between.” In everyday speech, it can mean excluding the endpoints. NETWORKDAYS, however, counts the start and end dates if each falls on a workday. In the January 6–17 example, both endpoints are weekdays, so both are counted. If the start or end falls on a Saturday or Sunday under the default weekend pattern, it is not counted.
This inclusive behavior is useful for questions such as “How many business days are in this project period?” or “How many working days does this service window cover?” It may not match a calculation where the starting day is not to be counted. For instance, if a task starts on Monday and you want to count the following workdays but not Monday itself, adjust the start date to Tuesday or subtract the starting workday when appropriate. Decide what the dates mean before interpreting the result.
The function counts full calendar workdays, not partial days. A date cell that also contains a time does not make the result a fraction of a workday. For hourly schedules or shifts that begin and end at specific times, a workday count alone is not sufficient; use a time-based calculation designed for that schedule.
Exclude public holidays or other nonworking dates
Use the optional third argument to provide dates that should not count as workdays. Put the holiday dates in a range, for example D2:D10, and keep them as real Excel dates rather than text that merely looks like a date. With January 6, 2025 in A2, January 17, 2025 in B2, and January 13, 2025 in D2 as a holiday, use =NETWORKDAYS(A2,B2,D2:D2). The result is 9, because January 13 is removed from the original total of 10.
A separate holiday list is usually easier to maintain than embedding dates in the formula. Add the organization’s relevant holidays to a column and extend the range as the list grows. You can also place the list on another worksheet; for example, if holiday dates are in H2:H20 on a sheet named Holidays, the formula can refer to Holidays!H2:H20. This is a cell reference, not a standalone formula.
- Include only dates that should be excluded from the workday count, such as observed public holidays or a company shutdown day.
- Use the same date basis as the work schedule. A regional holiday list may not apply to employees in another location.
- Check that a holiday entered as text is converted to a real date. Text dates can be interpreted differently depending on regional date settings.
Weekends are already excluded by the default function, so you generally do not need to add Saturdays and Sundays to the holiday range. A holiday that falls on a weekend does not remove an additional weekday from the count.
Use NETWORKDAYS.INTL for a different weekend
If the normal weekend is not Saturday and Sunday, use NETWORKDAYS.INTL. It adds a weekend argument so you can describe the nonworking days for your schedule. The function accepts a weekend number or a seven-character text pattern. In the pattern, the characters represent Monday through Sunday in order; 1 means a nonworking day and 0 means a working day.
For example, a Sunday-to-Thursday workweek has Friday and Saturday off. With A2 containing January 5, 2025 (Sunday) and B2 containing January 9, 2025 (Thursday), use =NETWORKDAYS.INTL(A2,B2,7). Weekend code 7 means Friday and Saturday, and the result is 5. The Monday-to-Sunday interval pattern 0000110 describes those same days off.
Codes 1 through 7 represent two-day weekends, beginning with the Saturday–Sunday weekend for code 1 and ending with Friday–Saturday for code 7. Codes 11 through 17 represent one nonworking day, from Sunday for 11 through Saturday for 17. A text pattern is handy for unusual schedules; for example, with dates in A2 and B2 and Friday and Saturday as the only weekend days, =NETWORKDAYS.INTL(A2,B2,"0000110") uses the explicit pattern. If holidays are also in D2:D10, add that range as the fourth argument: =NETWORKDAYS.INTL(A2,B2,"0000110",D2:D10).
Choose the weekend pattern carefully: it describes recurring days off, not holidays or one-off closures. The holiday range remains a separate argument. Both functions return a whole-day count and do not model different schedules for different employees within one calculation.
Set up dates and holiday data reliably
Excel stores valid dates as numbers, even when the cells display a month name or a regional date format. The formula works with those date values. If a date was imported from a text file or copied from a web page, it may only look like a date. A quick clue is that changing the cell’s number format does not display it as a date or a serial number. Convert such entries to real dates before relying on the calculation.
For a small example, type dates directly into A2 and B2 using a format Excel recognizes in your region, then apply a date format if needed. If you want to construct a date without relying on how text is interpreted, with the year in A2, month number in B2, and day number in C2, enter =DATE(A2,B2,C2) in D2. For 2025, 1, and 6 in those cells, the result is January 6, 2025. Use the resulting date cell as an argument to NETWORKDAYS.
Keep the start and end dates in separate cells, and keep holidays in a clearly labeled column. This makes it easier to inspect the inputs, copy the formula down a list of projects, and update a holiday calendar without editing every calculation. If you copy a formula down rows, references such as A2 and B2 adjust by row, while an absolute holiday reference such as $D$2:$D$10 stays fixed.
These function names and formula syntax work in Excel for Microsoft 365 on Windows. The same functions can be used in Excel for Mac and Excel for the web; the formula logic is the same, though the interface for entering and formatting cells can differ.
Handle reversed dates and common problems
If the start date is later than the end date, NETWORKDAYS returns a negative count rather than silently swapping the dates. For example, with January 6, 2025 in A2 and January 17, 2025 in B2, =NETWORKDAYS(B2,A2) returns -10. That can be useful when a signed difference is intentional, but it can also reveal that the dates were entered in the wrong order. If the output must always be nonnegative, verify the input order or deliberately use the earlier date as the start.
- An error appears: Check that the date arguments contain valid dates, that the holiday reference is a valid range, and that the formula uses commas between arguments in the usual English-language Excel syntax.
- The count is unexpectedly low: Inspect the holiday list for dates that overlap the interval and confirm that the weekend pattern matches the actual workweek.
- The count is unexpectedly high: Confirm that weekends are being excluded as intended and that all applicable holidays are in the supplied range.
- The answer displays as a date: Change the result cell’s number format to General or Number.
Do not subtract the calendar-day difference from a workday count or assume that all months contain the same number of workdays. NETWORKDAYS already evaluates each date in the interval against the selected weekend pattern and holiday list. Also check your start and end cells for missing values: a blank or invalid input can lead to a result that does not describe the period you intended.
Choosing between the two functions
Use NETWORKDAYS when Saturday and Sunday are always the weekend. Its shorter argument list is easy to read and is less likely to be misconfigured. Add the holiday range only when applicable. If all you need is a standard Monday-to-Friday count, there is no benefit to switching to the more configurable function.
Choose NETWORKDAYS.INTL when the weekend differs from Saturday and Sunday, or when you want to state the weekend explicitly. It is also useful when the result needs to be consistent across workbooks where readers might otherwise assume a default. Specify a weekend code or pattern that matches the schedule, then provide holidays separately if necessary.
Neither function is a replacement for a detailed shift calendar. If a business operates different schedules by person, location, or date, a single repeating weekend definition may not describe the rules. In that case, a custom calendar that marks each date as working or nonworking can be more suitable, especially when exceptions are frequent. The simple functions are most effective when the workweek is predictable and the holiday list is clear.
Frequently Asked Questions
Does NETWORKDAYS count the start and end dates?
Yes. It includes either endpoint if that date is a working day under the chosen weekend pattern. Weekend dates and dates listed as holidays are excluded.
How do I count workdays and exclude holidays?
Put the holiday dates in a range and use that range as the third argument of NETWORKDAYS. For a different weekend pattern, use NETWORKDAYS.INTL and put the holiday range after its weekend argument.
How do I calculate workdays if Friday and Saturday are the weekend?
Use NETWORKDAYS.INTL with weekend code 7, or the seven-character pattern 0000110. The pattern positions run Monday through Sunday, with 1 marking a nonworking day.
Why does my workday formula return a negative number?
The start date is probably later than the end date. NETWORKDAYS returns a negative result for a reversed interval. Check the dates, or use the earlier date first if you want a positive count.
Can Excel count workdays between dates that include times?
The functions return whole workday counts, not elapsed hours or partial-day totals. If your question concerns hours worked, calculate from the time values and the applicable schedule rather than treating a workday count as an hourly result.
Can I use the same formula in Excel for Mac?
Yes. NETWORKDAYS and NETWORKDAYS.INTL are available in current Excel for Mac, and their formula behavior is the same. Ribbon and formatting controls may be arranged differently from Excel for Windows.
Related
- Excel Dependent Drop-Down Lists With Spaces: Setup Guide
- Excel Dependent Drop-Down List: 3 Levels
- Excel Dependent Drop-Down Lists with Dynamic Ranges
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Formula Bar Not Showing Text? Fixes That WorkIf Excel’s formula bar is missing, turn it back on with View > Show > Formula Bar in…
- Excel SUMIF After a Date: Formula and ExamplesTo sum values for dates strictly after a cutoff in Excel, use =SUMIF(A2:A100,">"&DATE(2024,1,1),B2:B100), where column A contains dates…
- Excel Formula for High and Low Values: MIN and MAXIn Excel, use =MIN(B2:B10) to find the lowest number in a range and =MAX(B2:B10) to find the highest.…
- Excel LET Function: How to Name and Reuse CalculationsUse Excel’s LET function to give a name to a value or calculation, then use that name elsewhere…
- NPV Analysis in Excel: Formula, Steps, and ExampleTo calculate net present value in Excel, enter the discount rate in one cell, put the initial investment…
- Excel Text Functions List: Names, Uses, and ExamplesExcel’s text functions help you extract, combine, clean, compare, format, and convert text or values. The main functions…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.