The dreaded #INVALID DATA TYPE error

I created what I thought was a simple nested IF statement, but got hit with an #INVALID DATA TYPE error.


Both columns have the Column Type = Text/Number

All "State" fields are populated with valid 2 character US state abbreviations.


What am I missing?


Formula:

=IF(OR(State@row, "AL", State@row, "KS", State@row, "MI", State@row, "MN", State@row, "OR", State@row, "SD", State@row, "WY", State@row, "CT"), "Redemption"

,IF(OR(State@row, "CA", State@row, "IL", State@row, "NE", State@row, "FL", State@row, "HI", State@row, "KY", State@row, "NC", State@row, "OK", State@row, "WI"), "Confirmation"

,IF(OR(State@row, "VT", State@row, "NM", State@row, "OH"), "Both"

, "N/A")))



Tags:

Best Answer

  • Ariana Arden
    Ariana Arden ✭✭✭✭
    Answer ✓

    Hi Rebekah!

    Your formula had errors within the OR statements. It should be State@row = [condition] instead of State@row, [condition]. I have corrected in the formula below. :)


    =IF(OR(State@row = "AL", State@row = "KS", State@row = "MI", State@row = "MN", State@row = "OR", State@row = "SD", State@row = "WY", State@row = "CT"), "Redemption", IF(OR(State@row = "CA", State@row = "IL", State@row = "NE", State@row = "FL", State@row = "HI", State@row = "KY", State@row = "NC", State@row = "OK", State@row = "WI"), "Confirmation", IF(OR(State@row = "VT", State@row = "NM", State@row = "OH"), "Both", "N/A")))

Answers

  • Ariana Arden
    Ariana Arden ✭✭✭✭
    Answer ✓

    Hi Rebekah!

    Your formula had errors within the OR statements. It should be State@row = [condition] instead of State@row, [condition]. I have corrected in the formula below. :)


    =IF(OR(State@row = "AL", State@row = "KS", State@row = "MI", State@row = "MN", State@row = "OR", State@row = "SD", State@row = "WY", State@row = "CT"), "Redemption", IF(OR(State@row = "CA", State@row = "IL", State@row = "NE", State@row = "FL", State@row = "HI", State@row = "KY", State@row = "NC", State@row = "OK", State@row = "WI"), "Confirmation", IF(OR(State@row = "VT", State@row = "NM", State@row = "OH"), "Both", "N/A")))

  • @Ariana Arden You are SO correct! I need more coffee.


    Thank you so much! Have a great day :)

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!