# Why won't the "or" formula work here?

• 0
• Question
• Updated 4 years ago

Here is my formula:

If([Related Client]=8 and ([ServiceAddress: Postal Code]<>"70114" or [ServiceAddress: Postal Code]<>"70131"), "Incorrect client for postal code")

Even when the postal code is 70114, it will produce the "incorrect client for postal code" result. If I do a formula without the "or" it works as intended. (i.e.: if([Related Client]=8 and ([ServiceAddress: Postal Code]<>"70114", Incorrect client for postal code")

• 52 Points

Posted 4 years ago

• 0

Ⲇanom the ultimate (Dan Diebolt), Champion

• 30,244 Points
If [ServiceAddress: Postal Code]="70114" then the two clauses in your if statement would be:

"70114"<>"70114" => false

"70114"<>"70131" => true

so the OR of the two clauses would be:

"70114"<>"70114" OR "70114"<>"70131"  => false OR true => true

So under these conditions the if statement is equivalent to:
If([Related Client]=8, "Incorrect client for postal code")
Is that what you expected?
• 72,620 Points
I think what you really mean is

If(
[Related Client]=8
and