user922871
user922871

Reputation: 467

Compare range of values. Conditional Formatting

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!

Upvotes: 0

Views: 1603

Answers (2)

Osm
Osm

Reputation: 2881

In order to do that

Go to Format > Conditional formatting > format cell if... and Choose Custom formula. and Paste this formula in "Value or Formula". take a look at the Example Sheet.

=IF(A2:A="",,B2:B>A2:A)

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.

Upvotes: 1

marikamitsos
marikamitsos

Reputation: 10573

You can use in Custom formula is

=B1>A1

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

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

Upvotes: 0

Related Questions