+ Reply to Thread
Results 1 to 7 of 7

Combine columns, removing duplicates

  1. #1
    Registered User
    Join Date
    12-23-2008
    Location
    USA
    Posts
    60

    Combine columns, removing duplicates

    I have the following setup
    column A | column B

    david | chris
    john | david
    ted | egore

    What I want to do is combine the two column, but ignore duplicates, so the output would be

    david
    john
    ted
    chris
    egore

    How would I go about that?

    Thanks,

    David

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Combine columns, removing duplicates

    Quickest method might to be to do:

    C1: Name

    Copy A1:Ax to C2 onwards
    Copy B1:bx to Cx onwards (below existing names)

    Run an advanced filter on C -> copying unique records to another location, ie D1 .

  3. #3
    Registered User
    Join Date
    12-23-2008
    Location
    USA
    Posts
    60

    Re: Combine columns, removing duplicates

    If there are thousands of names in each column, what is the best way to perform that "Copy A1:Ax to C2 onwards"? I'd imagine its not recommended to highlight copy/paste that much data?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Combine columns, removing duplicates

    Shouldn't matter too much... if you have lots & lots & lots of data I'd suggest saving & closing other files just in cash you have a memory issue.

    You could possibly use keyboard shortcuts, assuming no blanks interspersed amongst names:

    highlight A1 -> CTRL + SHIFT + DOWN ARROW -> CTRL + C -> go to C2 -> ALT + E -> S -> V -> OK
    ... rept for B pasting below last value in C

  5. #5
    Registered User
    Join Date
    12-23-2008
    Location
    USA
    Posts
    60

    Re: Combine columns, removing duplicates

    Ok i'm trying with a simple example so that we can disregard the combining columns problem. So say there is just a single column

    david
    kris
    tony
    hayley
    kristy
    john
    david
    test
    hello
    david

    The result of the advanced filter without copying duplicates gets rid of one david, but not 2 (there are originally 3)

    david
    kris
    tony
    hayley
    kristy
    john
    david
    test
    hello

    why would that be?

    Thanks,
    Dave

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Combine columns, removing duplicates

    In my post I mentioned that you should perhaps add "Name" above the first row of copied data... without it XL sees the first name as a header (ie David appears as header and then again as a unique value).

    If above the first instance of David you entered Name and re-ran the entire process you should find David appears only once, the first instance of David being replaced by "Name".

  7. #7
    Registered User
    Join Date
    12-23-2008
    Location
    USA
    Posts
    60

    Re: Combine columns, removing duplicates

    Ok that works, thanks! Seems odd you can't do it without a header - what does the header have to do with this operation?

+ 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