Date formula help: return 90 days earlier than start date, on the closest Tuesday
Answers
-
Hi Vyanessa,
This will look complicated, but it's actually fairly straight forward when broken down. Keep in mind you'll have to paste this into a Date Type of column.
Try this:
=IF(WEEKDAY([Start Date]@row - 90) = 1, ([Start Date]@row - 90) + 2, IF(WEEKDAY([Start Date]@row - 90) = 2, ([Start Date]@row - 90) + 1, IF(WEEKDAY([Start Date]@row - 90) = 3, [Start Date]@row - 90, IF(WEEKDAY([Start Date]@row - 90) = 4, ([Start Date]@row - 90) - 1, IF(WEEKDAY([Start Date]@row - 90) = 5, ([Start Date]@row - 90) - 2, IF(WEEKDAY([Start Date]@row - 90) = 6, ([Start Date]@row - 90) - 3, IF(WEEKDAY([Start Date]@row - 90) = 7, ([Start Date]@row - 90) + 3)))))))
Broken Down:
=IF(WEEKDAY([Start Date]@row - 90) = 1, ([Start Date]@row - 90) + 2,
IF(WEEKDAY([Start Date]@row - 90) = 2, ([Start Date]@row - 90) + 1,
IF(WEEKDAY([Start Date]@row - 90) = 3, [Start Date]@row - 90,
IF(WEEKDAY([Start Date]@row - 90) = 4, ([Start Date]@row - 90) - 1,
IF(WEEKDAY([Start Date]@row - 90) = 5, ([Start Date]@row - 90) - 2,
IF(WEEKDAY([Start Date]@row - 90) = 6, ([Start Date]@row - 90) - 3,
IF(WEEKDAY([Start Date]@row - 90) = 7, ([Start Date]@row - 90) + 3)))))))
This formula looks at what the day of the week is, 90 days before the Start Date. If it's a Sunday (or day 1 of the week), then it will minus 90 days, but then add two to get to the nearest Tuesday.
If it's a Monday (day 2 in the week), it only needs to minus 90 days and then add 1 to get to the nearest Tuesday.... and so on.
Here are some Help Center articles I used: WEEKDAY function / Using Dates in Formulas / @row Function
Let me know if you have any questions about this!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
Thank you so much, this worked! Appreciate your help.
-
Great! Happy to help. 😊
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!