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
- Customer Resources
- 64.8K Get Help
- 434 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!