# Comparing 3 columns

Closed
Jose D Chiong - Aug 6, 2015 at 07:17 AM
Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 - Aug 8, 2015 at 12:19 PM
Hello,

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
Related:

## 3 responses

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Aug 6, 2015 at 11:22 AM
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
Jose D Chiong
Aug 7, 2015 at 06:23 PM
Hi Trowa,

Thanks for the answer, but I don't get it. Should I write all of the above formula in one cell?
Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 147
Aug 8, 2015 at 12:19 PM
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.
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