NETWORKDAYS Functions – Examples in Excel , VBA, G Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on November 6, 2023
Download Example Workbook

Download the example workbook

This tutorial demonstrates how to use the NETWORKDAYS Function in Excel to get the number of business days between dates.
NETWORKDAYS Main Function

Calculate Business / Working Days

The NETWORKDAYS Function calculates the number of business days between two dates:

=NETWORKDAYS(B4,C4)

NETWORKDAYS Positive

If the end_date is before the start_date NETWORKDAYS will return a negative value:

=NETWORKDAYS(B4,C4)

NETWORKDAYS NegativeTo return the absolute number of working days, use the ABS Function:

=ABS(NETWORKDAYS(B4,C4)

NETWORKDAYS ABS

By default, NETWORKDAYS will ignore all holidays. However you can use a 3rd optional argument to define a range of holidays:

=NETWORKDAYS(B4,C4,F3:F4)

NETWORKDAYS With Holiday

NETWORKDAYS in Google Sheets

The NETWORKDAYS Function works exactly the same in Google Sheets as in Excel:

NETWORKDAYS Google sheet

NETWORKDAYS Examples in VBA

You can also use the NETWORKDAYS function in VBA. Type:

application.worksheetfunction.networkdays(start_date,end_date,holidays)

Executing the following VBA statements

Range("C2") = Application.WorksheetFunction.Days360(Range("A2"), Range("B2"), False)
Range("C3") = Application.WorksheetFunction.Days360(Range("A3"), Range("B3"), False)
Range("C4") = Application.WorksheetFunction.Days360(Range("A4"), Range("B4"), False)
Range("C5") = Application.WorksheetFunction.Days360(Range("A5"), Range("B5"), False)
 
Range("D2") = Application.WorksheetFunction.Days(Range("B2"), Range("A2"))
Range("D3") = Application.WorksheetFunction.Days(Range("B3"), Range("A3"))
Range("D4") = Application.WorksheetFunction.Days(Range("B4"), Range("A4"))
Range("D5") = Application.WorksheetFunction.Days(Range("B5"), Range("A5"))
 
Range("E2") = Application.WorksheetFunction.NetworkDays(Range("A2"), Range("B2"))
Range("E3") = Application.WorksheetFunction.NetworkDays(Range("A3"), Range("B3"))
Range("E4") = Application.WorksheetFunction.NetworkDays(Range("A4"), Range("B4"))
Range("E5") = Application.WorksheetFunction.NetworkDays(Range("A5"), Range("B5"))

will produce the following results:

Vba DAYS360 function

For the function arguments (start_date, etc.), you can either enter them directly into the function, or define variables to use instead.

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions