+ Reply to Thread
Results 1 to 5 of 5

Delete duplicates based on multiple column data - Mailing List

  1. #1
    Registered User
    Join Date
    08-25-2004
    Location
    Kent, England
    Posts
    14

    Delete duplicates based on multiple column data - Mailing List

    Dear All

    Please could you help with this:
    I have four mailing lists containing 27000 rows which contain school names and addresses.
    I need to delete out any duplicates in each list - but the duplicates must be based on both the Name and Postcode.
    There are many occasions where a school will have the same name as another, but be in different parts of the country, or have the same postcode, but be at opposite ends of the street, so they should only delete if they duplicate on both.
    Example data below....I am currently doing this manually so I would appreciate help!

    1. School A Sheffield SH5
    2. School B Liverpool LA1
    3. School A London DN2
    4. School C Kent ME12
    5. School B Liverpool LA1

    I would expect to lose either line 2 or 5 as these are exact matches.
    (Forgive my inaccurate postcodes, I've just tried to produce easy examples)

    All I know how to do is use conditional formatting to show me the duplicates, but then I have to go through deciding which to keep. I have seen various hints and tips involving VB but as I know nothing about this I can't resolve the issue...
    Help very welcome.

    Thank you

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete duplicates based on multiple column data - Mailing List

    The Data > Filter > Autofilter is perfect for this task.

    1) Create a "key column" in your data that concatenates the school name and the post code into one cell
    2) Create a "dupe check" column with a formula that counts how many times the value in each row appears in the data down to that row.
    3) Use the AutoFilter to see only the rows with a dupe check value greater than 1
    4) Delete all visible rows
    5) Turn off the autofilter and clear your helper columns.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-25-2004
    Location
    Kent, England
    Posts
    14

    Re: Delete duplicates based on multiple column data - Mailing List

    Thank you for your help so far, although I've been able to set up the data as suggested, the Countif doesn't seems to be highlight rows that aren't duplicates. I only ran it for the first 38 lines as a trial to start with, and have attached the results of this. Further help would be appreciated.

    Thank you!
    Attached Files Attached Files

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Delete duplicates based on multiple column data - Mailing List

    it should look something like this
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    08-25-2004
    Location
    Kent, England
    Posts
    14

    Re: Delete duplicates based on multiple column data - Mailing List

    All good so far, thank you for the new example.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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