+ Reply to Thread
Results 1 to 5 of 5

Three-way Conditional Formatting for Duplicates?

  1. #1
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Three-way Conditional Formatting for Duplicates?

    Hey,

    I'm having a little issue with some conditional formatting not sure what the best way to go... I'm using the following:
    Please Login or Register  to view this content.
    I need it to check, Column A:A for duplicates if one is a dupelicate then it needs to check if the column B:B on the same row is a dupelicate and then if they still match it needs to check column c:c if all 3 match then I need it to highlight the row...

    I don't know if this is easier doing in a macro.... if it is easier doing it in a macro then I would want it to check all Columns from A to J and if they all match then it needs to remove the entire row.

    So:

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Three-way Conditional Formatting for Duplicates?

    The condition is:

    =AND(COUNTIF($A:$A,$A2)>1,COUNTIF($B:$B,$B2)>1,COUNTIF($C:$C,$C2)>1)


    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    09-07-2010
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Three-way Conditional Formatting for Duplicates?

    Quote Originally Posted by TMShucks View Post
    The condition is:

    =AND(COUNTIF($A:$A,$A2)>1,COUNTIF($B:$B,$B2)>1,COUNTIF($C:$C,$C2)>1)


    Regards
    Could it be converted into a macro by any chance to remove the row if all are matchs?

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Three-way Conditional Formatting for Duplicates?

    Using three COUNTIFS won't check if the three values are all repeated on another row, that just checks whether the values are repeated, possibly on separate rows.

    To check for repeats of the whole row I suggest you need COUNTIFS, this version will highlight all matches (e.g. if there are 3 matching rows it will format all 3)

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

    or to format all repeats after the first

    =COUNTIFS($A$1:$A1,$A1,$B$1:$B1,$B1,$C$1:$C1,$C1)>1
    Audere est facere

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Three-way Conditional Formatting for Duplicates?

    Put the formula into a helper column. This will highlight the duplicates with TRUE. Filter on the helper column for TRUE. Delete the visible records.

    If you want a macro, record the actions you take for the basic code; you'll need to tidy it up a bit to generalise it and make it more efficient.

    It's not clear to me if you want to delete all duplicates or leave one live. Might be easier to do if they're sorted and compare values between rows.

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1