The NETWORKDAYS function in a Google Spreadsheet can be used to count the number of working days between two dates. The function automatically removes weekend days from the total. Specific holidays can also be omitted.
The syntax for the NETWORKDAYS function is:
= NETWORKDAYS ( start_date , end_date , holidays )
The function's three arguments are:
start_date - the start date of the chosen time period
end_date - the end date of the chosen time period
holidays - can be used to exclude one or more dates from the total number of working days (optional)
Counting Days Between Two Dates Example
- Enter the following data into the appropriate cell:
A1 - Start:
A2 - Finish:
A3 - Holiday 1:
A4 - Holiday 2:
A5 - Working Days:
B1 - 7/7/2008
B2 - 11/7/2008
B3 - 9/8/2008
B4 - 10/13/2008
Note: If the dates in cells B1 to B4 do not appear correct, check to see that these cells are formatted for dates.
- Click on cell B5 - the location where the results will be displayed.
- Click on Insert > Formula > More Formulas in the menus to bring up the Insert a formula dialog box.
- Click on Date in the left hand side of the dialog box to show the list of available date functions.
- Double click on the word NETWORKDAYS in the right hand side to enter that function into cell B5 in the spreadsheet.
- Close the function dialog box by clicking on the close button in the top right corner of the dialog box.
- Drag select the start_date argument in the function in B5 to highlight it.
- When doing this Do Not highlight the commas that separate the arguments. They must not be removed or the function will give you an error message.
- Click on cell B1 on the spreadsheet to enter that cell reference into the function as the start_date.
- Drag select the end_date argument in the function in B5 to highlight it.
- Click on cell B2 in the spreadsheet to enter that cell reference into the function as the end_date.
- Drag select the holidays argument in the function in B5 to highlight it.
- Drag select cells B3 and B4 in the spreadsheet to enter those cell references into the function as holidays to be excluded.
- Press the ENTER key on the keyboard to complete the function.
- The number of working days - 88 appears in cell B5.
- There are 90 weekdays between the start and end dates. From this number the two holidays in cells B3 and B4 are subtracted to leave 88 working days.
- When you click on cell B5 the complete function
= NETWORKDAYS ( B1 , B2 , B3 : B4 ) appears in the formula bar above the worksheet.