+ Reply to Thread
Results 1 to 3 of 3

Remove Duplicate (Prioritized on data in a different column)

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    Roanoke, VA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Question Remove Duplicate (Prioritized on data in a different column)

    Hi All!! I'm new to this forum, I searched through other threads and didn't see an answer to my question, but if i overlooked i'm sorry, and if you could point me in the right direction it would be great!

    My question is: Is there a way to remove duplicates, but prioritized by data on a different column? Example:

    Acct # Yes/No
    1234 1
    1234 1
    1212 0
    1212 0
    5444 0
    5444 1
    6767 1
    6767 0
    8787 0
    8787 0
    9191 1
    9191 1

    I need it to sort out all the duplicates. If in the 2nd column of the duplicates has a "1" and a "0" in it, to leave the row that has the "1" in it and remove the one that has the "0". Or if they both have a "0" then leave one that has a "0", or if they both have a "1" then leave one that has a "1".
    So example of the results from the previous raw data:

    Acct # Yes/No
    1234 1
    1212 0
    5444 1
    6767 1
    8787 0
    9191 1

    as you can see both the 5444 and 6767 had both "0"'s and "1"'s and it only left the "1"'s.

    Bottom line the "1"s take priority over the "0"s but if they both have "0"s then it needs to remain "0".

    I hope my question isn't confusing.

    I know a little about using VBA to program a macro, so if this can be done with a formula or a marco it will be very helpful to me.

    Thanks for your help in advance.
    Last edited by rmikulas; 07-08-2010 at 08:21 AM.

  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: Remove Duplicate (Prioritized on data in a different column)

    Here's a little macro to do it:
    Please Login or Register  to view this content.
    _________________
    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
    07-07-2010
    Location
    Roanoke, VA
    MS-Off Ver
    Excel 2007
    Posts
    24

    Thumbs up Re: Remove Duplicate (Prioritized on data in a different column)

    Thank you SOOOOO much.... I had really been having trouble trying to figure this one out!!! You just saved me HOURS of work everyday!! Thank you thank you!!!

+ 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