IF statement for multiple IDs
I have a column with multiple IDs and I want to select specific IDs and "complete" = 1 else 0.
My current formula is :
=IF(CONTAINS("000", [GAP Status ID]@row, 1, IF(CONTAINS("010", [GAP Status ID]@row, 1, IF(CONTAINS("020", [GAP Status ID]@row, 1, IF(CONTAINS("100", [GAP Status ID]@row, 1, IF(CONTAINS("110", [GAP Status ID]@row, 1, IF(CONTAINS("120", [GAP Status ID]@row, 1, IF(CONTAINS("130", [GAP Status ID]@row, 1, IF(CONTAINS("140", [GAP Status ID]@row, 1, IF(CONTAINS("150", [GAP Status ID]@row, 1, IF(CONTAINS("160", [GAP Status ID]@row, 1, IF(CONTAINS("900", [GAP Status ID]@row, 1, 0))))))))))))))))))))))
I get the error #INCORRECT ARGUEMNET SET. Not sure what I am doing wrong.
Best Answer
-
Close your Contains with )
= IF(CONTAINS("000", [GAP Status ID]@row), 1, IF(CONTAINS("010", [GAP Status ID]@row), 1, IF(CONTAINS("020", [GAP Status ID]@row), 1, IF(CONTAINS("100", [GAP Status ID]@row), 1, IF(CONTAINS("110", [GAP Status ID]@row), 1, IF(CONTAINS("120", [GAP Status ID]@row), 1, IF(CONTAINS("130", [GAP Status ID]@row), 1, IF(CONTAINS("140", [GAP Status ID]@row), 1, IF(CONTAINS("150", [GAP Status ID]@row), 1, IF(CONTAINS("160", [GAP Status ID]@row), 1, IF(CONTAINS("900", [GAP Status ID]@row), 1, 0)
We can further simplify:
=IF(OR( CONTAINS("000", [GAP Status ID]@row), CONTAINS("010", [GAP Status ID]@row), CONTAINS("020", [GAP Status ID]@row), CONTAINS("100", [GAP Status ID]@row), CONTAINS("110", [GAP Status ID]@row), CONTAINS("120", [GAP Status ID]@row), CONTAINS("130", [GAP Status ID]@row), CONTAINS("140", [GAP Status ID]@row), CONTAINS("150", [GAP Status ID]@row), CONTAINS("160", [GAP Status ID]@row), CONTAINS("900", [GAP Status ID]@row) ), 1, 0)
...
Answers
-
Close your Contains with )
= IF(CONTAINS("000", [GAP Status ID]@row), 1, IF(CONTAINS("010", [GAP Status ID]@row), 1, IF(CONTAINS("020", [GAP Status ID]@row), 1, IF(CONTAINS("100", [GAP Status ID]@row), 1, IF(CONTAINS("110", [GAP Status ID]@row), 1, IF(CONTAINS("120", [GAP Status ID]@row), 1, IF(CONTAINS("130", [GAP Status ID]@row), 1, IF(CONTAINS("140", [GAP Status ID]@row), 1, IF(CONTAINS("150", [GAP Status ID]@row), 1, IF(CONTAINS("160", [GAP Status ID]@row), 1, IF(CONTAINS("900", [GAP Status ID]@row), 1, 0)
We can further simplify:
=IF(OR( CONTAINS("000", [GAP Status ID]@row), CONTAINS("010", [GAP Status ID]@row), CONTAINS("020", [GAP Status ID]@row), CONTAINS("100", [GAP Status ID]@row), CONTAINS("110", [GAP Status ID]@row), CONTAINS("120", [GAP Status ID]@row), CONTAINS("130", [GAP Status ID]@row), CONTAINS("140", [GAP Status ID]@row), CONTAINS("150", [GAP Status ID]@row), CONTAINS("160", [GAP Status ID]@row), CONTAINS("900", [GAP Status ID]@row) ), 1, 0)
...
-
Thank you @heyjay ! That was it!!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.3K Get Help
- 423 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 143 Just for fun
- 59 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 300 Events
- 39 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!