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!
Best 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
-
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", ""))))))))))))
...
-
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!
-
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), "")
-
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
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.9K Get Help
- 379 Global Discussions
- 210 Industry Talk
- 441 Announcements
- 4.6K Ideas & Feature Requests
- 139 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 301 Events
- 33 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!