# Help with filter logic

I'm trying to set up filter criteria which works, unlike what I have below.

``````(1 AND 2) OR (8 AND 9) OR
(1 AND 3) AND 4)) NOT (8 AND 9) OR
(1 AND 5) NOT (8 AND 9) OR
(1 AND 6) NOT (8 AND 9) OR
(7 AND 6) NOT (8 AND 9) OR
(7 AND 2) NOT (8 AND 9)
``````

Essentially, I want the filer logic to alert when `1 AND 2` match, only if `8 AND 9` do not match. So it's ok if `1 AND 2` match, as long as `8 AND 9` do not match. This same logic applies to `1 AND 3 AND 4`, `1 AND 5`, `1 AND 6`, `7 AND 6`, `7 AND 2`.

Hoping someone can help!

• As a bit of a hint for OP (Original Poster of the question), if a common thing appears in all of your terms (e.g. in `(1 OR 2) AND (1 OR 3) AND (1 OR 4)`, the `1` is common to all the terms), you can simplify things by pulling the common part out so that it only appears once (e.g. `1 OR (2 AND 3 AND 4)` in this case). Knowing a bit of Boolean Algebra (mostly DeMorgan's Law, Law of Distributivity of and/or over or/and, and Absorption Law) really helps. Oct 24, 2017 at 13:19