Macro or Formula to highlight duplicate values

Dazzawm

Well-known Member
Joined
Jan 24, 2011
Messages
3,748
Office Version
  1. 365
Platform
  1. Windows
I have a sheet with data set out as below. I need a macro or formula that will either highlight duplicate values or remove them.

The code firstly needs to look at column C. When they all match it then needs to look at column AD and AH to see if there are duplicates.

In the example below you can see I have highlighted 3 different set of values in C. In the first set AD3, AD4 and AH3 and AH4 match so these are highlighted.

In the second set in C there are no duplicates (only in AD) so this is ignored.

In the last set they are 2 lots of duplicates.

Thanks


Excel 2010
CADAH
2FDFIE12 1001WFB19FR DS
3FDFIE12 1001WFB19FR PS
4FDFIE12 1001WFB19FR PS
5FDFIE12 1001NYARR
6FDFIE12 1004WFB19FR DS
7FDFIE12 1004WUV19FR PS
8FDFIE12 1004WFB19FR PS
9FDFIE12 1004NYARR
10FDFIE12 1008WFB22FR DS
11FDFIE12 1008WFB22FR DS
12FDFIE12 1008WFB16FR PS
13FDFIE12 1008WFB16FR PS
Sheet1
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Maybe
=SUMPRODUCT(($C$2:$C$13=$C2)*($AD$2:$AD$13=$AD2)*($AH$2:$AH$13=$AH2))>1
 
Upvote 0
Every result is False? The spreadsheet will start row 2 down to about 100,000.
 
Upvote 0
This is what I get from the data you showed


Excel 2013/2016
CDEF
2FDFIE12 1001WFB19FR DSFALSE
3FDFIE12 1001WFB19FR PSTRUE
4FDFIE12 1001WFB19FR PSTRUE
5FDFIE12 1001NYARRFALSE
6FDFIE12 1004WFB19FR DSFALSE
7FDFIE12 1004WUV19FR PSFALSE
8FDFIE12 1004WFB19FR PSFALSE
9FDFIE12 1004NYARRFALSE
10FDFIE12 1008WFB22FR DSTRUE
11FDFIE12 1008WFB22FR DSTRUE
12FDFIE12 1008WFB16FR PSTRUE
13FDFIE12 1008WFB16FR PSTRUE
Sheet2
Cell Formulas
RangeFormula
F2=SUMPRODUCT(($C$2:$C$13=$C2)*($D$2:$D$13=$D2)*($E$2:$E$13=$E2))>1


Coloured cells represent what I get using the formula in CF
 
Upvote 0
I still cant get it to work. In the formula it seems to have the final row as 13 like the example is, like I say mine has about 100,000+
 
Upvote 0
Just change the 13 to a number that you are unlikely to exceed
 
Upvote 0
Thanks Fluff, think I've sorted it.
 
Upvote 0
Glad to here that & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,237
Messages
6,123,805
Members
449,127
Latest member
Cyko

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