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 Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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