Home > database >  Compare range of values. Conditional Formatting
Compare range of values. Conditional Formatting

Time:07-21

As of now, I would like to compare a range of values (different rows but same cells) and highlight them according to the result.

Let's say that we have Row A with some numbers and Row B also with numbers.

A   B
10  5
20  30
30  40

I would like to use conditional formatting to highlight cells in Row B if they are greater than in Row A. Like iterate through each of them, compare A1 < B1 (A2 < B2.. A"X" < B"X") and highlight each of them if the cell is greater.

Could you support me on this? Thanks in advance!

CodePudding user response:

In order to do that

Go to Format > Conditional formatting

Explanation

IF Range A2:A is Empty "" Do nothing ,, if isn't Empty check if B2:B > A2:A if TRUE Highlight green if FALSE do nothing.

CodePudding user response:

You can use in Custom formula is

=B1>A1

OR (to take into account empty cells in column A)

=AND(B1>A1,A1<>"")
  • Related