Syntax. NETWORKDAYS(start_date,end_date,holidays)
Definition. This function returns the number of workdays within a given time interval.
Arguments
start_date (required). The date that represents the start of the time interval.
end_date (required). The date that represents the end of the time interval.
holidays (optional). An array of one or more dates representing work-free days to exclude from the working calendar, such as federal holidays and floating holidays. The array can be a cell range containing the dates or an array constant with serial numbers for the dates.
Background. With the NETWORKDAYS() function, you can calculate salaries based on the number of workdays.
The function excludes weekends (Saturdays and Sundays) by default. You can also enter your holiday list into a cell range and name this range free_days to exclude these dates from the calculation.
Problems might occur if you enter dates as text. If one of the arguments isn’t a valid date, the NETWORKDAYS() function returns the #VALUE!
error.
Remember that the function counts the day of the start date. If you compare this with the result from the WORKDAY() function, you will see that you have to pass one day fewer in the days argument to WORKDAY().
For more information about saving dates in Excel, see the section titled The Excel Date System in Chapter 2.
Example. Assume that a project is planned to extend over the period from December 12, 2008, through June 2, 2009. You have to calculate the number of workdays in this timeframe, excluding holidays. The formula
=NETWORKDAYS("12/12/10","06/02/11",{"12/25/10","01/01/11","01/17/11","02/21/11", "05/30/2011","07/04/11"})
returns 121
workdays for the project. Note that in the preceding formula, holidays are enclosed in braces and not in parentheses. Figure 7-5 shows the calculation using cell references for the start date, end date, and holidays.