3 Ways to Count Weekends in a Project Duration

--

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

GitHub:
https://github.com/havishmad/excel_count_weekends

--

--

HAVISH MADHVAPATY
HAVISH MADHVAPATY

Written by HAVISH MADHVAPATY

Founder @ Havish M Consulting | 40u40 [Analytics Insight] | AuthorX20 | MOS | MCDA | MCT | Taught at IIM ABCLK

No responses yet