Help setting up formula IF
Hi there,
I'm trying to set up an IF formula to pull the Month from the "due date" row. I've been using the following formula:
IF(MONTH(DATE@row) = 1, "January", IF(MONTH(DATE@row) = 2, "February"....)
Although we have a cut off date which is the 25th of every month. All projects due after this date should be pushed to the next month. I was wondering if there's a way to create a date range so that when the day is greater than 25, the formula would show the following month.
I thought using IF(MONTH(DATE@row) = 1, AND(DATE(DATE@row), <25), "January", but I don't think that's correct.
I appreciate your help.
Thanks!
Best Answer
-
You can do this to get the month to advance if the date is the 25th or greater. It is lengthy but the second part is needed to go back from month 12 to month 1.
=IF(AND(DAY(Date@row) > 24, MONTH(Date@row) < 12), 1 + MONTH(Date@row), IF(AND(DAY(Date@row) > 24, MONTH(Date@row) = 12), 1, MONTH(Date@row)))
I'd leave that as a helper column called month number and just hide it. Then have a month column to change the number to text like you showed.
=IF([Month Number]@row = 1, "JAN", IF([Month Number]@row = 2, "FEB", IF([Month Number]@row = 3, "MAR", IF([Month Number]@row = 4, "APR", IF([Month Number]@row = 5, "MAY", IF([Month Number]@row = 6, "JUN", IF([Month Number]@row = 7, "JUL", IF([Month Number]@row = 8, "AUG", IF([Month Number]@row = 9, "SEP", IF([Month Number]@row = 10, "OCT", IF([Month Number]@row = 11, "NOV", IF([Month Number]@row = 12, "DEC"))))))))))))
Answers
-
You can do this to get the month to advance if the date is the 25th or greater. It is lengthy but the second part is needed to go back from month 12 to month 1.
=IF(AND(DAY(Date@row) > 24, MONTH(Date@row) < 12), 1 + MONTH(Date@row), IF(AND(DAY(Date@row) > 24, MONTH(Date@row) = 12), 1, MONTH(Date@row)))
I'd leave that as a helper column called month number and just hide it. Then have a month column to change the number to text like you showed.
=IF([Month Number]@row = 1, "JAN", IF([Month Number]@row = 2, "FEB", IF([Month Number]@row = 3, "MAR", IF([Month Number]@row = 4, "APR", IF([Month Number]@row = 5, "MAY", IF([Month Number]@row = 6, "JUN", IF([Month Number]@row = 7, "JUL", IF([Month Number]@row = 8, "AUG", IF([Month Number]@row = 9, "SEP", IF([Month Number]@row = 10, "OCT", IF([Month Number]@row = 11, "NOV", IF([Month Number]@row = 12, "DEC"))))))))))))
-
Hi @David Fiorino !
I really appreciate the help with my formula! I tested and it works perfectly.
Have a wonderful day. :)
Jeff Beltran
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
- 143 Just for fun
- 58 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!