In Microsoft Excel, the NETWORKDAYS function is used to count the number of dates between two specific dates. In this article, you’ll get to learn how to use this NETWORKDAYS function efficiently in Excel.
The above screenshot is an overview of the article which represents an application of the NETWORKDAYS function in Excel. You’ll learn more about the dataset as well as the methods and functions to count dates under different criteria in the following sections of this article.
Download Practice Workbook
You can download the Excel Workbook that we’ve used to prepare this article.
Introduction to NETWORKDAYS Function
- Function Objective:
Returns the number of whole workdays between two dates.
=NETWORKDAYS(start_date, end_date, [holidays])
- Arguments Explanation:
|start_date||Compulsory||Starting date between two specified dates.|
|end_date||Compulsory||End date between two specified dates.|
|[holidays]||Optional||Range of cells containing holidays as date format.|
- Return Parameter:
The number of days in numerical value.
3 Suitable Examples of Using NETWORKDAYS Function in Excel
1. NETWORKDAYS Function to Count Dates between Two Dates Excluding Weekends Only
In the picture below, Column B and Coumn C have a few start dates and end dates. Column D represents the total number of days between two dates from the previous two columns. In Column E, we’ll find out the number of working days excluding weekends (Saturday and Sunday).
➤ Select the output Cell E5 and type:
➤ Press Enter, use the Fill Handle to autofill the rest of the cells in Column E and you’re done.
You’ll get the number of working days between two dates excluding weekends at once.
2. NETWORKDAYS Function to Count Dates between Two Dates Excluding Weekends & Holidays
Now, we’ll include holidays in our function and the function will return with the number of working days between two dates excluding both weekends and the selected holidays from the range of cells D10:D18.
➤ Select Cell E5 and type:
➤ Press Enter, autofill the rest of the column with the Fill Handle and you’ll find the expected results right away.
Here, we have used absolute cell references for the range of cells containing holidays. If you don’t use absolute cell references here, then the cell references will change while auto-filling the cells in Column E, and the counting days will be incorrect.
- How to Use the NOW Function in Excel (8 Suitable Examples)
- Use SECOND Function in Excel (3 Examples)
- How to Use MINUTE Function in Excel (6 Examples)
- Use HOUR Function in Excel (5 Easy Examples)
- How to Use the Excel DAYS Function with a Practical Example
3. NETWORKDAYS Function to Count Dates between Two Dates Formatted as Text Strings
Sometimes we may have to count the number of working days between two dates that are in text format. In the picture below, Column B and Column C are representing a few start dates and end dates but they are not in number or date format. So, what we have to do is convert these text dates into the date codes by using the DATEVALUE function and then the NETWORKDAYS function will find the number of working dates between two dates.
➤ In Cell D5, the related formula will be:
➤ After pressing Enter and auto-filling the rest of the cells in Column D, you’ll get the number of days between two dates excluding weekends and holidays for each case in Columns B and C.
💡 Things to Keep in Mind
🔺 By default, the NETWORKDAYS function recognizes only Saturday and Sunday as weekends and you cannot customize these weekends. In this case, you have to use NETWORKDAYS.INTL function to customize weekends.
🔺 You have to be careful about inputting the start_date and end_date arguments sequences. Otherwise, the function will return with a negative value.
🔺 While inputting a range of cells containing holidays, make sure to use absolute cell references for holidays argument.
I hope all of the methods mentioned above to use the NETWORKDAYS function will now allow you to apply them in your Excel spreadsheets more effectively. If you have any questions or feedback, please let me know in the comment section. Or you can check out our other articles related to Excel functions on this website.