Networkdays Stopped Working - Again
"Harlan Grove" wrote in message
...
Using placeholders,
=EndDate-StartDate
-COUNTIF(Holidays,"="&StartDate)+COUNTIF(Holidays, ""&EndDate)
-2*INT((EndDate-WEEKDAY(EndDate,2)-StartDate+WEEKDAY(StartDate,2))/7)
-SIGN(WEEKDAY(EndDate,2)-6)+(WEEKDAY(StartDate,2)=7)
which in prose is
period in days between the two dates
-holidays during the period
-full weekends during the period
-tricky correction term
This works as long as the holiday dates don't fall on weekends. Does that
need to be taken into account? I guess it depends on where you work or the
application. Not all workplaces will adjust the holiday observance to the
preceding Friday or the following Monday. I used to work at a place that
wouldn't do that and I'm sure their reason was to avoid holiday pay.
--
Biff
Microsoft Excel MVP
|