I got my computer back.
Here is a more concise form of my formula.
Replace DesiredWeekday with the number for the weekday desired (Sunday = 0, Monday = 1, …) You will need to replace it in four spots.
This formula also relies on the fact that true
is represented internally as 1
, and false
is represented internally as 0
. This may not be apparent to non-coders. It is also not documented, so is subject to change, although it is so standard that I do not expect it to change.
DATETIME_DIFF(End, Start, 'weeks')
+
IF(
WEEKDAY(End) >= WEEKDAY(Start),
AND(
WEEKDAY(End) >= DesiredWeekday,
WEEKDAY(Start) <= DesiredWeekday
),
OR(
WEEKDAY(End) >= DesiredWeekday,
WEEKDAY(Start) <= DesiredWeekday
)
)