Return elapsed workdays in a month
This tutorial shows how to return the number of working days (business days) that have already passed in a specific month, based on a specific date, using an Excel formula or VBA
Example: Return elapsed workdays in a month
=-NETWORKDAYS(B5,EOMONTH(B5,-1)+1,$F$5:$F$12)
|
This formula uses the Excel NETWORKDAYS and EOMONTH functions to return the number of working days (business days) that have elapsed in a specific month based on a specific date, including the actual day of the specified date if it is a workday. It also takes into consideration the holidays that are in that particular month.
|
Sub Return_elapsed_workdays_in_month()
'declare variables
Dim ws As Worksheet
Dim ws As Worksheet
Set ws = Worksheets("Analysis")
'return the elapsed number of working days in a month
ws.Range("C5") = -WorksheetFunction.NetworkDays(ws.Range("B5"), WorksheetFunction.EoMonth(ws.Range("B5"), -1) + 1, ws.Range("F5:F12"))
End Sub
EXPLANATION
This tutorial shows how to return the number of working days that have gone past in a specific month, based on a specific date, through the use of an Excel formula or VBA.
The Excel and VBA methods both use the NETWORKDAYS and EOMONTH functions to return the elapsed number of workdays (business days) in a specific month, based on a specific date, including the actual day of the date if it is a workday.
FORMULA
=-NETWORKDAYS(date,EOMONTH(date,-1)+1,holidays)
=-NETWORKDAYS(date,EOMONTH(date,-1)+1,holidays)
ARGUMENTS
date: The date from which you want to extract the number of elapsed working days in that month.
holidays: A list of dates that captures the holidays to take into consideration.
date: The date from which you want to extract the number of elapsed working days in that month.
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 next working day | How to return the next work day (business day) using Excel and VBA |