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
- 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!