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

  • David Fiorino
    David Fiorino ✭✭✭
    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

  • David Fiorino
    David Fiorino ✭✭✭
    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"))))))))))))



  • 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

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!