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
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!