3 Ways to Count Weekends in a Project Duration
Dec 23, 2021
Let us say you want to count the weekends (assuming that would be Saturday and Sunday) in a Project Duration.
There are 3 different ways of getting the result.
The Formula:
=(C3-C2+1)-(NETWORKDAYS(C2,C3))
The VBA Code:
Function HMC_DATE_WEEKENDS(Startdate As Range, Enddate As Range)
workingdays = WorksheetFunction.NetworkDays(Startdate, Enddate)
calendardays = Enddate - Startdate + 1
HMC_DATE_WEEKENDS = calendardays - workingdays
End Function
The LAMBDA formula:
=LAMBDA(start_date,end_date, (end_date-start_date+1)-(NETWORKDAYS(start_date,end_date)))
YouTube:
https://youtu.be/Q0ZwTplzXF8