Conditional Formatting to highlight customers with duplicate values in another cell

matratus34

Board Regular
Joined
Nov 21, 2013
Messages
76
Hi - I have a list of customer IDs in Column A on my spreadsheet and in column A there is a Y or N flag for each customer.

The customer ID can appear on numerous rows but there should never be more than 1 Y in adjacent cell.

For example: if customer 100 appears on 6 rows then 5 rows should have a N in the adjacent cell and only 1 should have a Y
(There can also be zero Ys)

Could you please help me with some conditional formatting to highlight the customers where there are duplicate Ys?
I have tried but with no success.

In the example below I could want to highlight customer 3 as there are 2 Ys against it.

As always any help is greatly appreciated :)

A B
[TABLE="width: 185"]
<tbody>[TR]
[TD][TABLE="width: 199"]
<tbody>[TR]
[TD]Customer ID[/TD]
[TD]Offer[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]N[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Select column A, click Conditional Formatting > New Rule > Use a formula and enter:

=COUNTIFS(A:A,A1,B:B,"y")>1


Or maybe select column B and use this rule:

=AND(B1="y",COUNTIFS(A:A,A1,B:B,"y")>1)

which would highlight just the y's that are extra.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top