IF/Contains Formula Issue
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
-
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
-
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")))
-
Thanks...That worked perfectly!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.6K Get Help
- 433 Global Discussions
- 136 Industry Talk
- 465 Announcements
- 4.9K Ideas & Feature Requests
- 143 Brandfolder
- 147 Just for fun
- 63 Community Job Board
- 466 Show & Tell
- 32 Member Spotlight
- 2 SmartStories
- 298 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!