HI everyone, can someone tell me what’s the most efficient way of computing elapsed week given that we have a start date?
The week begins on Mondays.
Thanks
HI everyone, can someone tell me what’s the most efficient way of computing elapsed week given that we have a start date?
The week begins on Mondays.
Thanks
Subject: Calculating elapsed week
I’m not sure I understand your question fully, but @weekday will give you the day number of the week (1-sun, 7=sat) - will this help?
Subject: RE: Calculating elapsed week
assumptionMon to Sat= 1 week
Mon to next Tues= 2 week
Tues to next Mon= 2 week
Tues to Sun=1 week
just set the startdate and enddate to this variable (Date1 & Date2)
===================================
Date1:=@Date(2005;4;5);
Date2:=@Date(2005;4;10);
Date3:=@Explode(@ToTime(@Text(Date1)+“-”+@Text(Date2)));
sDay:=@Text(@Weekday(@ToTime(Date3)));
sDay:=@Replace(sDay;“1”:“2”:“3”:“4”:“5”:“6”:“7”;“1”:“7”:“6”:“5”:“4”:“3”:“2”);
nDays:=@Sum(@ToNumber(sDay)) ;
nDays:=@Integer(nDays/28)+1;
nDays
Subject: RE: Calculating elapsed week
assumptionMon to Sat= 1 week
Mon to next Tues= 2 week
Tues to next Mon= 2 week
Tues to Sun=1 week
just set the startdate and enddate to this variable (Date1 & Date2)
===================================
Date1:=@Date(2005;4;5);
Date2:=@Date(2005;4;10);
Date3:=@Explode(@ToTime(@Text(Date1)+“-”+@Text(Date2)));
sDay:=@Text(@Weekday(@ToTime(Date3)));
sDay:=@Replace(sDay;“1”:“2”:“3”:“4”:“5”:“6”:“7”;“1”:“7”:“6”:“5”:“4”:“3”:“2”);
nDays:=@Sum(@ToNumber(sDay)) ;
nDays:=@Integer(nDays/28)+1;
nDays
Subject: RE: Calculating elapsed week
Lai
Thanks. The formula worked beautifully.