![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have two dates: StartDate = 11/09/2009 ReportDate = 11/30/2009 I know that days elapsed is simply: [ReportDate] - [StartDate] = 21 Days But how do I get just WORKDAYS? The result would be 16 days in this example. I've searched previous posts and nothing really came up except some macros which didn't work for me. Thanks |
#3
| |||
| |||
|
|
jeromez <jeromezilin... (AT) gmail (DOT) com> wrote in news:5782c8c6-240d-4e52- 8f3b-36ce1d2ea... (AT) 26g2000yqo (DOT) googlegroups.com: I have two dates: StartDate = 11/09/2009 ReportDate = 11/30/2009 I know that days elapsed is simply: [ReportDate] - [StartDate] = 21 Days But how do I get just WORKDAYS? The result would be 16 days in this example. I've searched previous posts and nothing really came up except some macros which didn't work for me. Thanks Dorman Blackman posted this 11 years ago. Function BusinessDays(dDate1, dDate2) As Long * *BusinessDays = (DateDiff("d", dDate1, dDate2) - _ * * * * * * * * * * * * * *(DateDiff("ww", dDate1, dDate2) * 2) + 1) + _ * * * * * * * * * * * * * *(WeekDay(dDate1) = vbSunday) + _ * * * * * * * * * * * * * *(WeekDay(dDate2) = vbSaturday) End Function -- Bob Quintal PA is y I've altered my email address. |
![]() |
| Thread Tools | |
| Display Modes | |
| |