IF/Contains Formula Issue

Options

I'm having trouble trying to get my IF/Contains formula to work. I'm trying to label my equipment with either router or switch using a portion of the name.

For example. I know every nodename ending in 29101 is a router and every 37501 is a switch, but I have a few additional.

29101, 10001, 39201 - Router,

3750, 3850 - Switch

Getting Unparseable with the following forumal

=IF(CONTAINS(“2910”, [Nodename]@row, “Router”, IF(CONTAINS(“3920”, [Nodename]@row, “Router”, IF(CONTAINS(“3750”, [Nodename]@row, “Switch”)))


Best Answer

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓
    Options

    That particular error is coming from your quotes. See how they are slanted? Those are called "Smart Quotes" which (ironically enough) Smartsheet doesn't recognize. Notice the quotes in this comment how they are straight up and down? Those are the ones you need. You can get them by either retyping the formula directly in Smartsheet, here in the Community, or in a text editor such as Notepad (not Word).


    Having said that... There are also a few syntax issues. You forgot to close off the CONTAINS functions before moving on to the next portion of the IF. Give this one a go (quotes also fixed)...

    =IF(CONTAINS("2910", [Nodename]@row), "Router", IF(CONTAINS("3920", [Nodename]@row), "Router", IF(CONTAINS("3750", [Nodename]@row), "Switch")))

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!