Help

The Community will be temporarily unavailable starting on Friday February 28. We’ll be back as soon as we can! To learn more, check out our Announcements blog post.

return the Monday of the record's week

Topic Labels: Dates & Timezones Formulas
1676 4
cancel
Showing results for 
Search instead for 
Did you mean: 
kts
5 - Automation Enthusiast
5 - Automation Enthusiast

I'm trying to set up a formula that will give me the date of "Monday" relative to a given record's date. So if a record was dated today Wed June 21, I'd want the formula to give me Mon June 19.

I've done some searching on the forum here and found this formula:

 

DATEADD(Date,1-DATETIME_FORMAT(Date,'E'),'day')

But I'm having some issues with it—it's returning the date of Sunday, not Monday, and I can't for the life of me figure out how to adjust it!

Does anybody know how I might fix this? Thank you!

4 Replies 4
Sho
11 - Venus
11 - Venus

It seemed like an interesting problem, and I tried it!
How about this.

DATEADD(Date,8-WEEKDAY(Date),'day')

 

kts
5 - Automation Enthusiast
5 - Automation Enthusiast

Hmm, that seems to only return the next Sunday. ðŸ¤” I agree, it's a tricky problem!

Sho
11 - Venus
11 - Venus

I was wrong about before and after the week😹
How about this.

DATEADD(Date,WEEKDAY(Date)*-1-6,'day')

 Note that different Timezone between fields will cause time differences!

airtableguru22
4 - Data Explorer
4 - Data Explorer

After some playing around with formulas, this worked for me, just replace PostDate with your date field in question to return the Monday.


DATETIME_FORMAT
(DATEADD({PostDate},(0-(WEEKDAY({PostDate})
-1)),'day'),'M/DD/YYYY')