Counting Specific Days Between Two Dates

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
  )
)
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.