Formula to extract month name is not working

I'm using the following formula to extract the name of the month (e.g., "May" if there is a "5") but keep getting an "Invalid Data" error.

=IF(MONTH([SLA Month]@row) = 1, "January", IF(MONTH([SLA Month]@row) = 2, "February", IF(MONTH([SLA Month]@row) = 3, "March", IF(MONTH([SLA Month]@row) = 4, "April", IF(MONTH([SLA Month]@row) = 5, "May", IF(MONTH([SLA Month]@row) = 6, "June", IF(MONTH([SLA Month]@row) = 7, "July", IF(MONTH([SLA Month]@row) = 8, "August", IF(MONTH([SLA Month]@row) = 9, "September", IF(MONTH([SLA Month]@row) = 10, "October", IF(MONTH([SLA Month]@row) = 11, "November", IF(MONTH([SLA Month]@row) = 12, "December"))))))))))))

Any assistance would be greatly appreciated!! Thanks!

Tags:

Best Answer

  • bisaacs
    bisaacs ✭✭✭✭✭
    Answer ✓

    Hey @deb_63_hydracor,

    You should be able to input the formula like this:

    =IFERROR(IF(MONTH([SLA Month]@row) = 1, "January", IF(MONTH([SLA Month]@row) = 2, "February", IF(MONTH([SLA Month]@row) = 3, "March", IF(MONTH([SLA Month]@row) = 4, "April", IF(MONTH([SLA Month]@row) = 5, "May", IF(MONTH([SLA Month]@row) = 6, "June", IF(MONTH([SLA Month]@row) = 7, "July", IF(MONTH([SLA Month]@row) = 8, "August", IF(MONTH([SLA Month]@row) = 9, "September", IF(MONTH([SLA Month]@row) = 10, "October", IF(MONTH([SLA Month]@row) = 11, "November", IF(MONTH([SLA Month]@row) = 12, "December")))))))))))), "")

    It should work no problem (if the SLA Month is also a Date column)

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

Answers

  • heyjay
    heyjay ✭✭✭✭✭

    Double check that your date column actually has DATE as property. I modifid the last part of your formula and tested.

    =IF(MONTH([SLA Month]@row) = 1, "January", 
    IF(MONTH([SLA Month]@row) = 2, "February", 
    IF(MONTH([SLA Month]@row) = 3, "March", 
    IF(MONTH([SLA Month]@row) = 4, "April",
    IF(MONTH([SLA Month]@row) = 5, "May", 
    IF(MONTH([SLA Month]@row) = 6, "June",
    IF(MONTH([SLA Month]@row) = 7, "July",
    IF(MONTH([SLA Month]@row) = 8, "August", 
    IF(MONTH([SLA Month]@row) = 9, "September", 
    IF(MONTH([SLA Month]@row) = 10, "October",
    IF(MONTH([SLA Month]@row) = 11, "November", 
    IF(MONTH([SLA Month]@row) = 12, "December", 
    ""))))))))))))
    

    ...

  • bisaacs
    bisaacs ✭✭✭✭✭

    Hey @deb_63_hydracor,

    The SLA Month column, is that a date column or just a text/number column for the month?

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

  • deb_63_hydracor
    deb_63_hydracor ✭✭✭✭✭✭

    Thanks so both of you!

    It turns out that I was getting "Invalid Data Type" if the cell is blank. I have this formula in another column but don't know how to incorporate it into the formula above.

    =IFERROR(MONTH([SLA - Effective Date]@row), "")

  • bisaacs
    bisaacs ✭✭✭✭✭
    Answer ✓

    Hey @deb_63_hydracor,

    You should be able to input the formula like this:

    =IFERROR(IF(MONTH([SLA Month]@row) = 1, "January", IF(MONTH([SLA Month]@row) = 2, "February", IF(MONTH([SLA Month]@row) = 3, "March", IF(MONTH([SLA Month]@row) = 4, "April", IF(MONTH([SLA Month]@row) = 5, "May", IF(MONTH([SLA Month]@row) = 6, "June", IF(MONTH([SLA Month]@row) = 7, "July", IF(MONTH([SLA Month]@row) = 8, "August", IF(MONTH([SLA Month]@row) = 9, "September", IF(MONTH([SLA Month]@row) = 10, "October", IF(MONTH([SLA Month]@row) = 11, "November", IF(MONTH([SLA Month]@row) = 12, "December")))))))))))), "")

    It should work no problem (if the SLA Month is also a Date column)

    If my response was helpful in any way (or answered your question) please be sure to upvote it, mark it as awesome, or mark it as the accepted answer!

    I'm always looking to connect with other industry professionals, feel free to connect with me on LinkedIn as well!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!