Working Days calc

Working Days calc

Post by Rand Nowe » Wed, 08 May 2002 00:24:35



How would I calculate the Mon-Fri working days that are in any given
date range?
Gracias,
Rand
 
 
 

Working Days calc

Post by Glenn Schwand » Wed, 08 May 2002 01:41:09


WeekDays (calculation, number) = (((EndDate - DayofWeek( EndDate) + 1) -
(StartDate - DayofWeek( StartDate) + 1)) * (5 / 7)) - Choose( DayofWeek(
StartDate), 0, 0, 0, 1, 2, 3, 4, 5) + Choose( DayofWeek( EndDate), 0, 0, 1,
2, 3, 4, 5, 5)

This includes StartDate and EndDate if they are weekdays.  To omit the
StartDate, change the numbers in the first Choose statement to [0, 0, 1, 2,
3, 4, 5, 5].  To omit the EndDate, change the numbers in the second Choose
statement to [0, 0, 0, 1, 2, 3, 4, 5].


Quote:> How would I calculate the Mon-Fri working days that are in any given
> date range?
> Gracias,
> Rand