Color code on another cell if cell has duplicate value

aayaanmayank

Board Regular
Joined
Jul 20, 2018
Messages
157
Hi All,

Can anyone help me with. i have below data, if ID is duplicate then do the green color on next cell else yellow color...

[TABLE="width: 128"]
<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>[TR]
[TD="class: xl63, width: 64"]ID[/TD]
[TD="class: xl63, width: 64"]Country name[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]306560 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]4569087 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]896880 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]896880 [/TD]
[TD="class: xl64"]KR[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]9970980 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]9970980 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]423489 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]8076070 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]8858780 [/TD]
[TD="class: xl64"]US[/TD]
[/TR]
[TR]
[TD="class: xl64, align: right"]98724[/TD]
[TD="class: xl64"]US[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
i would use 2 conditional rules

rule 1 for any duplicate - yellow
=COUNTIF(A2:A11,A2)>1

rule 2 for next cell - green - use and put last in the order
=A2=A1
 
Upvote 0
use
=OR(A1=A2,A2=A3)

[TABLE="width: 174"]
<colgroup><col span="2"></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]Country name[/TD]
[/TR]
[TR]
[TD="align: right"]306560[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]4569087[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]896880[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]896880[/TD]
[TD]KR[/TD]
[/TR]
[TR]
[TD="align: right"]9970980[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]9970980[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]423489[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]8076070[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]8858780[/TD]
[TD]US[/TD]
[/TR]
[TR]
[TD="align: right"]4569087[/TD]
[TD]US[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:
Upvote 0
oh, OK - probably useful to have put that in the subject/title
 
Upvote 0

Forum statistics

Threads
1,226,729
Messages
6,192,696
Members
453,747
Latest member
tylerhyatt04

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