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
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!