Return workdays between dates

This tutorial shows how to return the number of working days (business days) between two dates using an Excel formula or VBA

Example: Return workdays between dates

Return workdays between dates

METHOD 1. Return workdays between dates using Excel formula

EXCEL

=NETWORKDAYS(B5,C5,$G$5:$G$12)
This formula uses the Excel NETWORKDAYS function to return the number of working days (business days) between two specific dates. As per this example, this formula also takes holidays into consideration.

METHOD 1. Return workdays between dates using VBA

VBA

Sub Return_workdays_between_dates()
'declare variables
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'return the number of working days between two dates

ws.Range("D5") = WorksheetFunction.NetworkDays(ws.Range("B5"), ws.Range("C5"), ws.Range("G5:G12"))

End Sub

Explanation about how to return workdays between dates

EXPLANATION

EXPLANATION

This tutorial shows how to return the number of working days between two dates through the use of an Excel formula or VBA.
The Excel and VBA methods both use the NETWORKDAYS function to return the number of workdays (business days) between two dates.
FORMULA
=NETWORKDAYS(start_date,end_date,holidays)
ARGUMENTS
start_date: The start date from which to begin counting the number of workdays.
end_date: The end date at which to stop counting the number of workdays.
holidays: A list of dates that captures the holidays to take into consideration.

RELATED TOPICS

Related Topic Description Related Topic and Description
How to return the remaining number of working days (business days) in a specific month, based on a specific date, using Excel and VBA
How to return the number of working days in a month using Excel and VBA
How to return the number of working days (business days) that have already passed in a specific month, based on a specific date, using Excel and VBA
How to return the next work day (business day) using Excel and VBA