To help identify issues faster I am trying to add conditional formatting for column Z to turn red if the amount in that column is greater than the amount in the columns AA or AB and only if column AA or AB is not 0.

I tried the following after putting “Z2:Z” for the Apply to range and “Custom formula is” for the Format rules:

=OR(Z2>AA2, Z2>AB2)

Also, I am starting from row 2 as row 1 contains the headers.

But I can not figure out how to specify the not 0 part for both column AA and AB.

This feels like it should be a pretty basic formula but I am bit rusty on my functions/statements.

1 Answer 1



=OR(AND(Z2>AA2,AA2<>0), AND(Z2>AB2,AB2<>0))
  • Pretty close, I reckon, but the OP says "and only if column AA or AB is not 0." So as I read it... for example, it's not just if (Z>AA and AA<>0), but it's if AB<>0.
    – Tedinoz
    Mar 20, 2022 at 11:34
  • A suggestion: =OR(AND(Z2>AA2,AA2<>0,AB2<>0), AND(Z2>AB2,AB2<>0,AA2<>0))
    – Tedinoz
    Mar 20, 2022 at 11:38
  • Thank you both, this worked out perfectly.
    – AMN52
    Mar 21, 2022 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.