Juanito Tomas
Juanito Tomas

Reputation: 151

I would like to change the color of a row if two rows with the same contents in one column differ in value in another column

So I have been working on this for a while now but can't seem to get it. Essentially if the contents in column C (NAME) match, I need to see if their rows match value in column K (Y/N).

If they differ in Column K, the entirety of both rows should turn yellow. Additionally, I would like that if they match in column C, and they are both "No" in column K, both rows turn red.

I believe this to be done as a custom rule in conditional formating but this is all I could come up with, unsure how to proceed. (I am operating in Google Sheets since its a shared doc but I can manage with Excel.

=AND($C1<>"",COUNTIF($C:$C,$C1)>1, COUNTIFS($C:$C,$C1,$K:$K,$K1)>0)

Some sample data; here both of Jane's rows should be red and Alex's rows should be yellow:

43425.45184 NA  Morg    4   7   5   6   7   6   6   Yes
43423.65523 NA  Alee    4   9   8   7   8   8   9   Yes
43425.4461  NA  Alee    4   8   8   8   8   8   8   Yes
43420.93822 NA  Bale    4   8   7   7   6   10  7   Yes
43424.40326 NA  Jane    5   9   8   8   9   9   7   No
43430.45766 NA  Jane    5   10  10  10  10  10  10  No
43424.51362 NA  Alex    3   8   8   8   4   6   6   Yes
43430.48237 NA  Alex    4   6   3   5   2   7   6   No
43428.76583 NA  Allison 4   8   8   8   7   6   8   Yes

Upvotes: 0

Views: 68

Answers (1)

SJR
SJR

Reputation: 23081

Think these two will do it.

=AND(COUNTIF($C:$C,$C1)=2,COUNTIFS($C:$C,$C1,$K:$K,"No")=2)

Above is fill red

=AND(COUNTIF($C:$C,$C1)=2,COUNTIFS($C:$C,$C1,$K:$K,"Yes")=1)

Above is fill yellow

enter image description here

enter image description here

Upvotes: 1

Related Questions