
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 28, 2020 12:26 PM
Hey! I’m trying to count the number of Mondays and Thursdays between two dates - does anyone have a formula or tip on how to achieve this?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 30, 2020 01:53 PM
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
)
)

- « Previous
- Next »