Consulting

Results 1 to 7 of 7

Thread: Solved: Match 3 cells?

  1. #1

    Solved: Match 3 cells?

    Hi

    I have a big list of names spread over 3 cells e.g.

    Mr Jon Black

    A lot of them are repeated and I'd like to remove the duplicates.

    If it were one cell I'd maybe use =A1=A2 to get TRUE/FALSE but not sure
    how to do for multi cells or if a macro would do it?

    Any help appreciated

    thanks
    Jon

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    In a helper column

    =SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2),--($C$2:C2=C2))>1

    and copy down.

    This will show the second of any duplicates, then you can filter this helper column for TRUE and delete the visible rows.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Tutor
    Joined
    Sep 2007
    Posts
    265
    Location
    Hi Bob,

    Sorry to bothering you.
    Can you advise, what is function for line -- and how we can use it?
    As I can't find this function in excel help.
    =SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2),--($C$2:C2=C2))>1

    Thanks & Rgds,
    Harto

  4. #4
    Moderator VBAX Master georgiboy's Avatar
    Joined
    Mar 2008
    Location
    Kent, England
    Posts
    1,209
    Location

    Count function

    You could use the count function

    =IF(COUNTIF(A:A,A1)>1,IF(COUNTIF(B:B,B1)>1,IF(COUNTIF(C:C,C1)>1,"Duplicate" ,""),""),"")

    This will label duplicates with the word Duplicate.

    hope this helps
    Click here for a guide on how to add code tags
    Click here for a guide on how to mark a thread as solved
    Click here for a guide on how to upload a file with your post

    Excel 365, Version 2404, Build 17531.20128

  5. #5
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by slamet Harto
    Hi Bob,

    Sorry to bothering you.
    Can you advise, what is function for line -- and how we can use it?
    As I can't find this function in excel help.
    =SUMPRODUCT(--($A$2:A2=A2),--($B$2:B2=B2),--($C$2:C2=C2))>1

    Thanks & Rgds,
    Harto
    Harto,

    it is all explained at this paper
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  6. #6
    Thanks Bob

    As ever your solutions do the job - suspect you know excel better than the developers themselves!

    regards

  7. #7
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Seriously, I have met some of the Excel developers, and they are not aware of the way that we in the real world use SUMPRODUCT and some of the other complex formulae combinations!
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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