Use the SerialDate function to get the number of days between your two dates. Substract the number of days from today to the last Sunday. Then divide the rest through 7. This will give you the number of weeks from last Sunday back to your target date. Substract 2 from the MOD 7. This is the number of weekdays from the very first Sunday.
code:
$starttdate=serialdate($startdate)
$enddate=serialdate($enddate)
$numberdays=$enddate-$startdate+1
$thisweek=@WDAYNO
$numberdays=$numberdays-$thisweek
$numberweeks=$numberdays/7
$numberdays=$numberdays MOD 7
$numberdays=$numberdays-2
$numberdays=$numberdays+$numberweeks*5
$numberdays=$numberdays+$thisweek
Untested, but one manual calculation gave the correct result. YMMV
_________________________
There are two types of vessels, submarines and targets.