+ Reply to Thread
Results 1 to 14 of 14

Remove duplicates but keep 2 of the same-

  1. #1
    Forum Contributor
    Join Date
    01-24-2013
    Location
    NY,NY
    MS-Off Ver
    MS 365
    Posts
    250

    Remove duplicates but keep 2 of the same-

    Hello,

    I have a list of over 1,000 entries and I would like to remove duplicates. But, I need to keep 2 of the exact same and remove the rest. Please see attached sample of the before and after.

    Any help is greatly appreciated.

    Thank you!
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: Remove duplicates but keep 2 of the same-

    You seem to have lost Job No 451245 (row 5) from your "After" table. Is it duplicate names that you are concerned with?

    Pete

  3. #3
    Forum Contributor
    Join Date
    01-24-2013
    Location
    NY,NY
    MS-Off Ver
    MS 365
    Posts
    250

    Re: Remove duplicates but keep 2 of the same-

    Quote Originally Posted by Pete_UK View Post
    You seem to have lost Job No 451245 (row 5) from your "After" table. Is it duplicate names that you are concerned with?

    Pete
    Basically, I need to know how many mechanics it takes to do the same job> they have duplicate business names and addresses so when I remove duplicates I only stay with one line and lose the rest. I need to keep 2 lines when removing duplicates. Is this possible?

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Remove duplicates but keep 2 of the same-

    Have you tried the remove duplicates function under the data tab?
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  5. #5
    Forum Contributor
    Join Date
    01-24-2013
    Location
    NY,NY
    MS-Off Ver
    MS 365
    Posts
    250

    Re: Remove duplicates but keep 2 of the same-

    Quote Originally Posted by Sambo kid View Post
    Have you tried the remove duplicates function under the data tab?
    Yes, but when I use it it removes all rows but one and my goal is to keep 2 identical rows per account.

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Remove duplicates but keep 2 of the same-

    with Olive starter you have three different mechanics, does that matter?

  7. #7
    Forum Contributor
    Join Date
    01-24-2013
    Location
    NY,NY
    MS-Off Ver
    MS 365
    Posts
    250

    Re: Remove duplicates but keep 2 of the same-

    Quote Originally Posted by Sambo kid View Post
    with Olive starter you have three different mechanics, does that matter?
    No but I would like to keep 2 of the same Job numbers.

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Remove duplicates but keep 2 of the same-

    well for me and without using the remove duplicates function I'd use a helper column with this formula in it dragged down...
    =COUNTIF($A$3:A3,A3)
    this only focuses on the job number and not the mechanic.
    then I'd apply a filter to the column where the countif is and using the filter I'd sort them ascending order, then filter out 1s and 2s (deselect) then delete those that are higher than 2.

  9. #9
    Forum Contributor
    Join Date
    01-24-2013
    Location
    NY,NY
    MS-Off Ver
    MS 365
    Posts
    250

    Re: Remove duplicates but keep 2 of the same-

    Quote Originally Posted by Sambo kid View Post
    well for me and without using the remove duplicates function I'd use a helper column with this formula in it dragged down...
    =COUNTIF($A$3:A3,A3)
    this only focuses on the job number and not the mechanic.
    then I'd apply a filter to the column where the countif is and using the filter I'd sort them ascending order, then filter out 1s and 2s (deselect) then delete those that are higher than 2.
    Ok I will try this.. Thank you,

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Remove duplicates but keep 2 of the same-

    It looks like making a unique distinct list matching 3 criterias: Job - 1st name - 2nd name? Then take 2 records each at least?
    Quang PT

  11. #11
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Remove duplicates but keep 2 of the same-

    Try in E2:

    Please Login or Register  to view this content.

  12. #12
    Forum Contributor
    Join Date
    01-24-2013
    Location
    NY,NY
    MS-Off Ver
    MS 365
    Posts
    250

    Re: Remove duplicates but keep 2 of the same-

    Quote Originally Posted by bebo021999 View Post
    Try in E2:

    Please Login or Register  to view this content.
    Your formula was not working. But thank you, for the help.

  13. #13
    Forum Contributor
    Join Date
    01-24-2013
    Location
    NY,NY
    MS-Off Ver
    MS 365
    Posts
    250

    Re: Remove duplicates but keep 2 of the same-

    Quote Originally Posted by Sambo kid View Post
    well for me and without using the remove duplicates function I'd use a helper column with this formula in it dragged down...
    =COUNTIF($A$3:A3,A3)
    this only focuses on the job number and not the mechanic.
    then I'd apply a filter to the column where the countif is and using the filter I'd sort them ascending order, then filter out 1s and 2s (deselect) then delete those that are higher than 2.
    Thank you this worked well!

  14. #14
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Remove duplicates but keep 2 of the same-

    If I have interpreted correctly this is another way.

    Array enter this in A19 and fill down. If you aren’t familiar with array-entered formulas array enter means the formula must be committed from edit mode by simultaneously pressing and holding down Ctrl and Shift while hitting Enter.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then array enter this in B19, fill down and across.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Remove duplicates not removing duplicates bug, so what???!!!
    By abdelrazzaq in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-19-2016, 01:43 PM
  2. Remove Duplicates in column and remove blanks
    By geliedee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-13-2015, 07:25 AM
  3. Remove duplicates function not removing duplicates
    By Berilium2 in forum Excel General
    Replies: 3
    Last Post: 04-01-2015, 06:55 AM
  4. Replies: 1
    Last Post: 10-23-2012, 09:12 AM
  5. Replies: 5
    Last Post: 02-28-2012, 02:52 PM
  6. Need VBA code to remove entries if there are duplicates (remove them totally)
    By BrandonFromSingapore in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-13-2012, 12:50 AM
  7. Replies: 2
    Last Post: 03-20-2011, 11:19 AM

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