How to combine an IF statement with Workday and MAX functions
Hi Friends,
I'm currently using the MAX function to determine the "Next Maintenance" date based on the "follow-up" columns as shown below. I'm looking for a way that if its output has a date of a weekend, it would automatically populate the next Monday date. As an example below, the next maintenance date coming from the MAX formula would be a weekend, and my goal is for it to directly have an output of August 23rd instead of 21st. Is it possible to add here an if statement with both Workday and MAX functions to serve the purpose or is there other ways of doing this?
Appreciate it!
Best Answer
-
Hi @Yousef J.
Hope you are fine, please try the following formula and convert it to column format formula ( If Saturday will add 2 days, if Sunday will add 1 day)
=IFERROR(IF(WEEKDAY(MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row)) = 7, MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row) + 2, IF(WEEKDAY(MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row)) = 1, MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row) + 1, MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row))), "")
the following screenshot shows the result:
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
Answers
-
Hi @Yousef J.
Hope you are fine, please try the following formula and convert it to column format formula ( If Saturday will add 2 days, if Sunday will add 1 day)
=IFERROR(IF(WEEKDAY(MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row)) = 7, MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row) + 2, IF(WEEKDAY(MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row)) = 1, MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row) + 1, MAX([Monthly - Follow-Up]@row:[Annual - Follow-Up]@row))), "")
the following screenshot shows the result:
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
-
It works! Thank you so much.
-
Excellent, i will be happy to help you any time.
bassam.khalil2009@gmail.com
☑️ Are you satisfied with my answer to your question? Please help the Community by marking it as an ( Accepted Answer), and I will be grateful for your "Vote Up" or "Insightful"
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63K Get Help
- 379 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 304 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!