Comparing 3 columns

[Closed]
Report
-
Posts
1942
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
September 2, 2021
-
Hello,

Please help me get the correct formula for this:

RETURN RED IF D1 lower than D2 and lower than D3
RETURN YELLOW IF D1 HIGHER than D2 and HIGHER than D3
RETURN BLUE IF D1 LOWER THAN D2 BUT HIGHER THAN D3
RETURN BLUE IF D1 HIGHER THAN D2 BUT LOWER THAN D3

Help would be much appreciated. TIA

3 replies

Posts
2805
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
September 14, 2021
481
Hi Jose,

So you are looking for the formula's to use with conditional formatting:
1) =AND(D1<D2,D1<D3)
2) =AND(D1>D2,D1>D3)
3) =OR(AND(D1<D2,D1>D3),AND(D1>D2,D1>D3))

You didn't mention any equals, so you might have to add the = symbol on your own.

Best regards,
Trowa

Hi Trowa,

Thanks for the answer, but I don't get it. Should I write all of the above formula in one cell?
Posts
1942
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
September 2, 2021
145
Jose D Chiong, Good afternoon.

TrowaD gave you the formulas that you must apply to the rules part at Conditional Format Menu.

Select cells you want to apply Conditional Formatting.
Conditional Format Menu
Using formula

Rule 1
=AND(D1<D2,D1<D3)
Format as Fill with RED color

Rule 2
=AND(D1>D2,D1>D3)
Format as Fill with YELLOW color

Rule 3
=OR(AND(D1<D2,D1>D3),AND(D1>D2,D1>D3))
Format as Fill with BLUE color

OK

Please, tell us if it worked for you.
I hope it helps.
--
Belo Horizonte, Brasil.
Marcílio Lobão