+ Reply to Thread
Results 1 to 7 of 7

Comparing Two columns to create column with duplicates

  1. #1
    Registered User
    Join Date
    04-28-2010
    Location
    Atlanta
    MS-Off Ver
    Excel 2003
    Posts
    4

    Comparing Two columns to create column with duplicates

    Hi All,

    I'm looking to compare two columns and then put the duplicate names from those columns into a third column. Can this be done? Thanks in advance!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Comparing Two columns to create column with duplicates

    Say your lists are in Column A and Column B, where B is the longer list...

    Then in C2, =IF(ISNUMBER(MATCH(B2,$A$2:$A$10,0)),COUNT(C$1:C1)+1,"") copied down... where A2:A10 is list in column A to match to value in B2

    in D2: =MAX(C2:C11) where C2:C11 corresponds with list in column B.

    Then in E2:

    =IF(ROWS($A$1:$A1)>$D$2,"",INDEX($B$2:$B$11,MATCH(ROWS($A$1:$A1),$C$2:$C$11,0)))

    copied down... again, where ranges line up with original data... adjust all as necessary.
    Attached Files Attached Files
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-28-2010
    Location
    Atlanta
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Comparing Two columns to create column with duplicates

    OK...I'm really a huge novice....How do you apply the formula? How do you copy down the formula?

    Thanks

  4. #4
    Registered User
    Join Date
    04-28-2010
    Location
    Atlanta
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Comparing Two columns to create column with duplicates

    I may have miss wrote the request.....I'm looking to have non-duplicates in the third column...Sorry for the confusion. Thanks

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Comparing Two columns to create column with duplicates

    For non-duplicates just change formula in C2 to:

    =IF(ISNA(MATCH(B2,$A$2:$A$10,0)),COUNT(C$1:C1)+1,"")

    and copy down the other formulas are the same.

    To copy down a formula, after you enter it, reselect the cell, then click, hold and drag down the little black square at the bottom right corner of the cell, drag it down to as far as you need to go and let go.

  6. #6
    Registered User
    Join Date
    04-28-2010
    Location
    Atlanta
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Comparing Two columns to create column with duplicates

    ?....Will this work with Alpha characters as well as numbers? I have a list of names...there are no numbers involved. Thanks in advance

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Comparing Two columns to create column with duplicates

    It should.

    It is checking for exact matches, whether numeric, alpha or alphanumeric... (if numeric, must be also same format... not mixed number,text).

    Test it out. If problematic, advise me.

+ 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