Calculating 2 dates need to subtract weekends and holidays

J

John

tried a couple of fomulars did not work here is what i have now can someone
help me
=DateDiff("ww",[Release
Date],[SHPMT_DATE],[DayOfWeek])-Int([DayOfWeek]=Weekday([Release Date]))
 
S

Steve Schapel

John,

In these sorts of problems, I often find myself that it helps to try to
express in ordinary English the result I am trying to obtain.
 
D

DevalilaJohn

Assuming that release and ship dates cannot be on week ends (and that week
ends are Saturday and sunday)

NumberOfDays = (DateDiff("d", ReleaseDate, Shpmt_Date, vbMonday) -
((DateDiff("ww", ReleaseDate, Shpmt_Date, vbMonday) - 1) * 2)) - 1

You may need a small tweek depending on how you count (or don't) the start
and end dates.
 
Top