Code To Find Duplicates And Highlight

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,748
Office Version
  1. 365
Platform
  1. Windows
Is there a code or formula for when there is matching cells in column C that will then look in column AE and highlight any duplicate values please?
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Select Column C. Navigate to Conditional Formatting. Click New Rule. Select New Rule with Formula. Paste the formula below:
Excel Formula:
=COUNTIF($AE:$AE,C1)>0
Define formatting.
 
Upvote 0
Select Column C. Navigate to Conditional Formatting. Click New Rule. Select New Rule with Formula. Paste the formula below:
Excel Formula:
=COUNTIF($AE:$AE,C1)>0
Define formatting.
Unless I am doing it wrong nothing happens? There is an option to use a formula to determine which cells to format?
 
Upvote 0
Discard it is in Turkish. The idea is the same.
 

Attachments

  • 1.PNG
    1.PNG
    5.7 KB · Views: 9
  • 2.PNG
    2.PNG
    25.2 KB · Views: 9
  • 3.PNG
    3.PNG
    34.7 KB · Views: 9
Upvote 0
Discard it is in Turkish. The idea is the same.
Still nothing. I will explain again. There could be anything from 1 to 10 cells/rows that match in C then it needs to look at AE for duplicate data amongst those rows, not the same as C, other types of data. Then moves onto the next set of rows where values are the same in C and so on...
 
Upvote 0
As you can see in the example below the two rows at the top that match in C are clear because there is different data in AE. The next set of 5 matching rows in C are highlighted because there is a duplicate of Data1 in AE.

ASVIR53 5001Data1
ASVIR53 5001Data2
AU10018 2001Data1
AU10018 2001Data1
AU10018 2001Data2
AU10018 2001Data3
AU10018 2001Data4
 
Upvote 0
OK try this rule. I tested:
Excel Formula:
=(SUM(IF(FREQUENCY(MATCH(IF($C$:$C$=C1,$AE$:$AE$),IF($C$:$C$=C1,$AE$:$AE$),0),MATCH(IF($C$:$C$=C1,$AE$:$AE$),IF($C$:$C$=C1,$AE$:$AE$),0))>0,1))-1)<>COUNTIF($C$:$C$,C1)
 
Upvote 0
Could you try again? I forgot extra $ signs:
Excel Formula:
=(SUM(IF(FREQUENCY(MATCH(IF($C:$C=C1,$AE:$AE),IF($C:$C=C1,$AE:$AE),0),MATCH(IF($C:$C=C1,$AE:$AE),IF($C:$C=C1,$AE:$AE),0))>0,1))-1)<>COUNTIF($C:$C,C1)
 
Upvote 0
Could you try again? I forgot extra $ signs:
Excel Formula:
=(SUM(IF(FREQUENCY(MATCH(IF($C:$C=C1,$AE:$AE),IF($C:$C=C1,$AE:$AE),0),MATCH(IF($C:$C=C1,$AE:$AE),IF($C:$C=C1,$AE:$AE),0))>0,1))-1)<>COUNTIF($C:$C,C1)
I cant say that was very successful, it ran for about an hour and crashed excel. It was a big file to be fair. Is there a macro that will do the same?
 
Upvote 0

Forum statistics

Threads
1,215,133
Messages
6,123,233
Members
449,092
Latest member
SCleaveland

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