Count the number of weekdays between two days

This formula will count the total weekdays between two days.
Lotus Formula


Start_Date :=@Today;
End_Date := Deadline;
REM "Count the number of Sat and Sun that lie within the date range and exclude them from the calc.";
days:=@Abs(@Integer((End_Date-Start_Date)/86400));
Total_Days := days;
t:=0:1:1:1:1:1:0:0:1:1:1:1:1:0;
m:=@Modulo(days;7);
value:=@If(m=0;0;@Subset(@Subset(t;@Weekday(Start_Date)+m);-m));
list:=@Subset(value:0:0:0:0:0:0:0:0;8);
@Set("list";((@Subset(list;4)+@Subset(list;-4))));
@Set("list";((@Subset(list;2)+@Subset(list;-2))));
@Set("list";((@Subset(list;1)+@Subset(list;-1))));
daysbetweentodayanddeadline := ((@Integer(days/7))*5)+list ;
daysbetweentodayanddeadline

Posted by fbrefere001 on Saturday November 12, 2005