NETWORKDAYS Excel Guide: Calculate Working Days
In this article
The NETWORKDAYS function in Excel calculates the number of whole working days between two dates, automatically excluding weekends (Saturday and Sunday) and an optional list of custom holidays. To use it, enter =NETWORKDAYS(start_date, end_date, [holidays]) into a cell, where the start and end dates are cell references or date strings, and the holidays argument is an optional range of cells containing holiday dates.
What You'll Need
- Microsoft Excel (any modern version, including Excel 365, 2021, 2019, or Excel for the Web).
- A dataset containing at least two dates (a start date and an end date).
- An optional list of holiday dates typed into a separate range of cells if you need to exclude public or company-specific holidays.
Step-by-Step
- Prepare Your Date Data: Enter your start date in one cell (e.g., A2) and your end date in another cell (e.g., B2). Ensure these cells are formatted as "Date" by selecting the cells, going to the Home tab, and choosing Date from the Number format dropdown menu.
- Create a Holiday List (Optional): If you want to exclude specific holidays (like New Year's Day or Independence Day), list these dates in a vertical column elsewhere in your spreadsheet (e.g., cells E2 through E10). This creates a reference range that the formula can check against.
- Enter the Basic Formula: Select the cell where you want the result to appear. Type
=NETWORKDAYS(. - Select the Start Date: Click on the cell containing your start date (A2) and type a comma.
- Select the End Date: Click on the cell containing your end date (B2).
- Add the Holiday Range: If you created a holiday list, type another comma and then highlight the range of cells containing your holidays (E2:E10). If you do not have holidays to exclude, you can simply close the parenthesis.
- Complete and Execute: Type the closing parenthesis
)and press Enter. Excel will now display the total number of working days between the two dates, inclusive of both the start and end date. - Apply to Multiple Rows: If you have a list of many date pairs, click the small green square (fill handle) at the bottom-right corner of the result cell and drag it down to apply the formula to the rest of your data. If you used a holiday range, remember to lock that range using absolute references (e.g.,
$E$2:$E$10) so the reference doesn't shift as you drag the formula down.
Common Mistakes
One of the most frequent errors is forgetting that the NETWORKDAYS function is inclusive. This means if your start date is Monday and your end date is Tuesday, Excel will return 2, not 1. If your business logic requires calculating the difference (exclusive of the start date), you must subtract 1 from the final result of the formula.
Another common mistake is entering dates as plain text rather than Excel date values. If you type "January 1st, 2023" into a cell and Excel does not recognize it as a date (it stays left-aligned), the NETWORKDAYS function will return a #VALUE! error. Always verify that your dates are right-aligned in the cell, which indicates Excel recognizes them as numeric date values.
Users often forget to use absolute references for the holiday range. If your formula is =NETWORKDAYS(A2, B2, E2:E10) and you drag it down to row 3, the formula becomes =NETWORKDAYS(A3, B3, E3:E11). This causes the formula to miss the first holiday in your list and potentially include empty cells, leading to inaccurate counts. Always use dollar signs (e.g., $E$2:$E$10) for the holiday argument.
Confusing NETWORKDAYS with NETWORKDAYS.INTL is another common pitfall. Standard NETWORKDAYS assumes Saturday and Sunday are the weekend. If your region or industry uses different weekend days (e.g., Friday and Saturday), the standard NETWORKDAYS function will provide the wrong answer. In those cases, you must use the .INTL version of the function.
Tips
To make your spreadsheet more dynamic, name your holiday range. Instead of highlighting E2:E10, select those cells and type "CompanyHolidays" into the Name Box (the small box to the left of the formula bar). Your formula then becomes =NETWORKDAYS(A2, B2, CompanyHolidays). This makes the formula much easier to read and prevents errors when moving data around.
If you need to calculate the end date based on a known number of working days (rather than calculating the days between two known dates), use the WORKDAY function. While NETWORKDAYS tells you "how many days," WORKDAY tells you "what date." These two functions are complementary and often used together in project management trackers.
For those working in international environments, remember that the holiday list is manual. Excel does not have a built-in database of global holidays because they change by year and region. It is a best practice to create a dedicated "Settings" or "Reference" tab in your workbook where all holiday dates for the current year are stored, keeping your main data sheet clean.
If you are dealing with a massive dataset, avoid entering dates directly into the formula as strings (e.g., =NETWORKDAYS("2023-01-01", "2023-01-10")). While this works, it makes the spreadsheet difficult to update. Always link to cells so that changing a date in one place updates all your calculations automatically.
Troubleshooting
If your formula returns a #VALUE! error, the most likely cause is an invalid date. Check your start and end date cells. If they are formatted as text, the formula cannot perform the math. Try re-typing the dates or using the "Text to Columns" feature under the Data tab to convert them back to Date format.
If the result is a very large number or a strange date (like January 15, 1905), it is because the result cell is formatted as a "Date" instead of a "Number." Because Excel stores dates as numbers, it sometimes tries to be helpful by formatting the result of a date formula as a date. Go to the Home tab, open the Number format dropdown, and change the format to "General" or "Number." This will reveal the actual count of days.
If the count seems off by one or two days, check your holiday list. Ensure there are no blank cells within your holiday range, as this can sometimes cause erratic behavior in older versions of Excel. Also, double-check that your start and end dates are in the correct order. While NETWORKDAYS can handle a start date that is later than the end date, it will return a negative number, which might confuse your reporting if you are expecting a positive integer.
If you are using a non-standard work week (e.g., you work on Saturdays), the standard NETWORKDAYS function will always subtract Saturdays. To fix this, replace NETWORKDAYS with NETWORKDAYS.INTL. This version adds a fourth argument called "weekend," where you can enter a code (like 11 for "Sunday only") to tell Excel exactly which days should be excluded.
Frequently Asked Questions
Does NETWORKDAYS count the start and end date?
Yes, the function is inclusive. If the start date is Monday and the end date is the same Monday, the result is 1. If the end date is Tuesday, the result is 2.
Can I exclude only one specific day of the week?
No, the standard NETWORKDAYS function always excludes both Saturday and Sunday. To exclude only one day or a custom set of days, you must use the NETWORKDAYS.INTL function.
What happens if the start date is after the end date?
Excel will return a negative number. For example, if the start date is Friday and the end date is the previous Monday, the result will be negative.
Do I have to include the holiday argument?
No, the holiday argument is optional. If you leave it blank, Excel will only exclude Saturdays and Sundays from the total count.
Can I use a range of cells from another worksheet for holidays?
Yes. When selecting the holiday range, simply click over to the other sheet and highlight the dates. Excel will automatically include the sheet name in the formula reference.
Why is my result showing as a date instead of a number?
This happens when the cell is formatted as a Date. Change the cell formatting to "General" or "Number" via the Home tab to see the actual count of working days.