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
=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.
|
Sub Return_workdays_between_dates()
'declare variables
Dim ws As Worksheet
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
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)
=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.
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 |
---|---|---|
Return remaining workdays in a month | How to return the remaining number of working days (business days) in a specific month, based on a specific date, using Excel and VBA | |
Return workdays in a month | How to return the number of working days in a month using Excel and VBA | |
Return elapsed workdays in a month | 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 | |
Return next working day | How to return the next work day (business day) using Excel and VBA |