Date Calculation Formula to Return Friday of Week Calculated
I'm looking to return the Friday of the week that my date calculation result falls.
For instance, I have a formula that calculates a Start Date by using "Due Date" - 40 WORKDAYS. I need to then have the result show the Friday of that week. My first WORKDAY formula works fine on its own, but not with IF(WEEKDAY...... added.
Based on other searches I tried:
=WORKDAY([Due Date]955, -40) + IF(WEEKDAY (WORKDAY ([Due Date]955), -40) <6, "6"))
Also tried:
=IF(WEEKDAY(WORKDAY([Due Date (Pagination)]959, -45)) < 6, 6)
Neither worked. How do I enter this formula?
Best Answer
-
This may not be the most elegant solution, but it gets the job done for me.
First, place a helper column with the formula below; in this example the helper column is named "Column":
=WORKDAY([Due Date]@row, -40)
Next, in the Start Date column, place the following formula:
=IF(WEEKDAY(Column@row) = 1, (Column@row + 5), IF(WEEKDAY(Column@row) = 2, (Column@row + 4), IF(WEEKDAY(Column@row) = 3, (Column@row + 3), IF(WEEKDAY(Column@row) = 4, (Column@row + 2), IF(WEEKDAY(Column@row) = 5, (Column@row + 1), IF(WEEKDAY(Column@row) = 6, (Column@row), IF(WEEKDAY(Column@row) = 7, (Column@row + 6))))))))
Note that Saturday and Sunday are included in the above formula.
Answers
-
This may not be the most elegant solution, but it gets the job done for me.
First, place a helper column with the formula below; in this example the helper column is named "Column":
=WORKDAY([Due Date]@row, -40)
Next, in the Start Date column, place the following formula:
=IF(WEEKDAY(Column@row) = 1, (Column@row + 5), IF(WEEKDAY(Column@row) = 2, (Column@row + 4), IF(WEEKDAY(Column@row) = 3, (Column@row + 3), IF(WEEKDAY(Column@row) = 4, (Column@row + 2), IF(WEEKDAY(Column@row) = 5, (Column@row + 1), IF(WEEKDAY(Column@row) = 6, (Column@row), IF(WEEKDAY(Column@row) = 7, (Column@row + 6))))))))
Note that Saturday and Sunday are included in the above formula.
-
Thanks for getting back to me. I'll try that out. I was thinking a helper column may be needed, but was trying to avoid the extra column on the sheet. As long as it works, it will do.
Thanks so much!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 144 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!