Compare 2 columns and conditionally format duplicates Excel 2007

Anne Troy

MrExcel MVP
Joined
Feb 18, 2002
Messages
2,603
I would rather accomplish this with conditional formatting, but I am willing to do it with code.

The sample file is here: http://annetroy.com/ms/sample2columndupes.xlsx (what happened to being able to upload a workbook here? Hmmm.... anyway...)

I need to compare the values of the SET (both columns) of data in each row with the rest of the rows and highlight the duplicates.

Note that row 5 and row 6 are the same. Either the first record or second record or both should be formatted with red fill.
There is another set duplicated in rows 178 and 179.

I don't want to use a helper column. I know how to do that.

I thank you so much for your time. If you cannot understand my request, I will try to reword it.
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Weazel

Well-known Member
Joined
Dec 24, 2011
Messages
3,155
maybe something like...

=SUMPRODUCT(($M$2:$M$707=$M2)*($N$2:$N$707=$N2))>1

in the conditional formatting dialog box
 

Anne Troy

MrExcel MVP
Joined
Feb 18, 2002
Messages
2,603
I can't tell if it works because so many cells are blank. Is there any way to add the condition that they're not blank? Thanks, Weazel!
 

Weazel

Well-known Member
Joined
Dec 24, 2011
Messages
3,155
How about something like...?

=SUMPRODUCT(($L$2:$L$707=$L2)*($M$2:$M$707=$M2)*($L$2:$L$707<>"")*($M$2:$M$707<>""))>1
 

Watch MrExcel Video

Forum statistics

Threads
1,123,076
Messages
5,599,627
Members
414,326
Latest member
kfg1287

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
Top