Valid If - NOT - OR

I am trying to check if some items are chosen from an EnumList and make the choices valid if.....

So invalid if it contains either of these 2 selections:

NOT(AND(CONTAINS([Gate Check Results], "*Central Padlock* Good Working Order"),CONTAINS([Gate Check Results], "*Central Padlock* Poor Working Order")))

OR invalid if it contained these 2 selections:

NOT(AND(CONTAINS([Gate Check Results], "*Drop-Bolt Padlock* Good Working Order"),CONTAINS([Gate Check Results], "*Drop-Bolt Padlock* Poor Working Order")))

I was hoping to add the following to bring them together as an OR. but that hasn't seemed to work:

OR((NOT(AND(CONTAINS([Gate Check Results], "*Central Padlock* Good Working Order"),CONTAINS([Gate Check Results], "*Central Padlock* Poor Working Order")))),(NOT(AND(CONTAINS([Gate Check Results], "*Drop-Bolt Padlock* Good Working Order"),CONTAINS([Gate Check Results], "*Drop-Bolt Padlock* Poor Working Order")))))


Where have I gone wrong because it doesn't work.

Solved Solved
0 8 144
1 ACCEPTED SOLUTION

Sorry for a late reply as I was in travel and not at my desk to test.

My testing shows that the first suggestion of using AND()in place of OR() works.

Please take a look at the GIF below. The valid if uses AND() in place of OR() for combining the two sub- expressions.

chrome-capture-2024-2-29.gif

May I request you to retest with AND(). I used the following sub expression in valid_if to test

AND(
NOT(AND(CONTAINS([Enumlist_Test], "*Central Padlock* Good Working Order"),CONTAINS([Enumlist_Test], "*Central Padlock* Poor Working Order"))) ,

NOT(AND(CONTAINS([Enumlist_Test], "*Drop-Bolt Padlock* Good Working Order"),CONTAINS([Enumlist_Test], "*Drop-Bolt Padlock* Poor Working Order")))
)

 

My testing showed that even the second suggestion works in valid_if. I mean the suggestion to use IFS() based expression.

 

View solution in original post

8 REPLIES 8
Top Labels in this Space