Updating a cell based on checkbox column and a multi-select column
Hi there,
I am new to SmartSheets and am struggling to use the CONTAINS formula. I need to allow for the option for [Trial Type] to be either Sales Strip, Sales Demo, or both Sales Strip and Sales Demo
The formula below doesn't work if both Sales Strip and Sales Demo are selected.
Do I need to use the CONTAINS function? Or is there another way to make this work if both are selected in the [Trial Type] column?
=IF(AND(Parent1 = 1, OR([Trial Type]1 = “Sales Strip”, [Trial Type]1 = “Sales Demo”)), TODAY(+10))
Thanks for your help
Best Answer
-
@Gil Nash Having the OR inside of the AND statement the way it is in the original post is fine.
=IF(AND(OR(valueA, valueB), value1)
will work the same as
=IF(AND(value1, OR(valueA, valueB))
@Patrick Miller Try this...
=IF(AND(Parent1 = 1, OR(CONTAINS(“Sales Strip”, [Trial Type]1), CONTAINS(“Sales Demo”, [Trial Type]1))), TODAY(+10))
Answers
-
Just as a general rule, the OR would need to be wrapped up under the AND (=IF(AND(OR(value1, value2), value2), TRUE, FALSE))
Having said that, I think this will work.
=IF(ISBLANK([Trial Type]@row), "", IF(Parent@row = 1, TODAY(+10), ""))
-
@Gil Nash Having the OR inside of the AND statement the way it is in the original post is fine.
=IF(AND(OR(valueA, valueB), value1)
will work the same as
=IF(AND(value1, OR(valueA, valueB))
@Patrick Miller Try this...
=IF(AND(Parent1 = 1, OR(CONTAINS(“Sales Strip”, [Trial Type]1), CONTAINS(“Sales Demo”, [Trial Type]1))), TODAY(+10))
-
@Paul Newcome I've never been able to get that to parse correctly but I'm sure it was probably a typo on my end. Good to know though
-
@Gil Nash The easiest way to remember it is that the OR is considered a single "logical statement" for the AND function regardless of how many logical statements are inside of the OR function. Basically you write the OR function as you should, then drop it into any logical statement section of the AND function.
AND(logical_statement_1, logical_statement_2)
AND(logical_statement_1, OR(..........))
AND(logical_statement_1, logical_statement_2)
AND(OR(..........), logical_statement_2)
The OR could even be "logical_statement_2" of 3 if you happen to have that many within your AND. It is just making sure that you have the OR built properly and then dropping it into the AND as a single piece.
AND(logical_statement_1, logical_statement_2, logical_statement_3)
AND(logical_statement_1, OR(..........), logical_statement_3)
-
Thank you so much @Gil Nash and @Paul Newcome
Since I have additional options in the multi-select, this answer seemed to work the best
=IF(AND(Parent1 = 1, OR(CONTAINS(“Sales Strip”, [Trial Type]1), CONTAINS(“Sales Demo”, [Trial Type]1))), TODAY(+10))
I really appreciate your time
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 139 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 494 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!