The dreaded #invalid data type

Hi guys,


I'm progressing with my basic formula however what do i need to add into the below formula as an example so i don't get the unsightly #invalid data type in a cell just because the start date is blank?


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

Tags:

Answers

  • Dan W
    Dan W ✭✭✭✭✭
    edited 07/13/22

    IFERROR. Toss that in the front and the value you want if an error occurs at the end. I just put 0. You could put "" to leave it blank

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


    https://help.smartsheet.com/function/iferror

  • CAS
    CAS ✭✭✭✭

    Thanks Dan,

    I understand now appreciate your help.

    I tweaked the formula to the below so it just leaves it blank.


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

  • Dan W
    Dan W ✭✭✭✭✭

    Cool deal happy to help!

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!