complicated conditional formatting for duplicates

jimrward

Well-known Member
Joined
Feb 24, 2003
Messages
1,897
Office Version
  1. 2021
  2. 2019
  3. 2016
  4. 2013
  5. 2011
  6. 2010
  7. 2007
  8. 2003 or older
Platform
  1. Windows
in simple terms I have one to many columns of data, for simplicity lets use columns A, B, C

A, B, C
297, 295, 293
296, 295
297, 295, 292
294

now it is easy enough to highlight dupes in column A with COUNTIF() > 1

what i would like to do is highlight cell in Column B, which is associated as already being a duplicate in column A

so in the example above 297 would be highlighted in A2 and A4
and I would like only B2 and B4 highlighted in B, as these are associated as dupes, and NOT B3 as it is not a duplicate in A

so the formula needs to be logically connected to the countif in A
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Why not just select columns A and B and use a formula like this:

=COUNTIF($A:$A, $A1)>1
 
Upvote 0
ok that highlights entries in column A which are dupes, but it also highlights the cells in column be which are not dupes

the row with the dupe in A needs to check B to see if this is also a dupe in column B

the scenario is for a competition results

if there are any ties in column A, then highlight, so that I know to add extra criteria in column B, if still a tie in Column B, then add further set of criteria.
in highlighting ties I only need to add extra where required as opposed to doing it for all the results
 
Last edited:
Upvote 0
Hey guys,

What about countifs?

Code:
=COUNTIFS($A:$A, $A1,$B:$B, $B1)>1

Hope this helps,

Robert D. Specian Jr.
 
Upvote 0
afraid that did not work robert, no dupes detected at all
 
Upvote 0
In col D =COUNTIF(A:A,A1)>1.
In Col E =COUNTIF(B:B,B1)>1.

Conditional Formatting for A1 should be Formula is =D1=TRUE
Conditional Formatting for B1 should be Formula is =(AND(D1=TRUE,E1=TRUE))

That won't distinguish if the duplicates in B are on the corresponding rows to thos in A. ie. these are ALL duplicates, but no row is the same:

297 206
258 248
297 248
258 206
 
Upvote 0
all items on one row relate to each other I have added my own helper column where I concatenate A and B and use the countif on this for column B

=COUNTIF($D:$D, $D1)>1 where D contains

297295
296295
297295
294

column A I just use countif
 
Upvote 0

Forum statistics

Threads
1,224,531
Messages
6,179,379
Members
452,907
Latest member
Roland Deschain

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