1. Computing

Discuss in my forum

Count Days Between Dates in a Google Spreadsheet

Google Spreadsheet NETWORKDAYS Function

By , About.com Guide

Calculate Days Between Dates with Google Spreadsheet NETWORKDAYS Function

Calculate Days Between Dates with Google Spreadsheet NETWORKDAYS Function

© Ted French

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

Note: For help with this example, see the image above.

  1. 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.

  2. Click on cell B5 - the location where the results will be displayed.

  3. Click on Insert > Formula > More Formulas in the menus to bring up the Insert a formula dialog box.

  4. Click on Date in the left hand side of the dialog box to show the list of available date functions.

  5. Double click on the word NETWORKDAYS in the right hand side to enter that function into cell B5 in the spreadsheet.

  6. Close the function dialog box by clicking on the close button in the top right corner of the dialog box.

  7. Drag select the start_date argument in the function in B5 to highlight it.

  8. 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.

  9. Click on cell B1 on the spreadsheet to enter that cell reference into the function as the start_date.

  10. Drag select the end_date argument in the function in B5 to highlight it.

  11. Click on cell B2 in the spreadsheet to enter that cell reference into the function as the end_date.

  12. Drag select the holidays argument in the function in B5 to highlight it.

  13. Drag select cells B3 and B4 in the spreadsheet to enter those cell references into the function as holidays to be excluded.

  14. Press the ENTER key on the keyboard to complete the function.

  15. The number of working days - 88 appears in cell B5.

  16. 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.

  17. When you click on cell B5 the complete function
    = NETWORKDAYS ( B1 , B2 , B3 : B4 ) appears in the formula bar above the worksheet.


Other Google Spreadsheet Articles

©2013 About.com. All rights reserved.