+ Reply to Thread
Results 1 to 10 of 10

How to remove duplicates AND values that have duplicates?

  1. #1
    Registered User
    Join Date
    01-03-2014
    Location
    91362
    MS-Off Ver
    Excel 2013
    Posts
    14

    How to remove duplicates AND values that have duplicates?

    How to remove duplicates AND values that have duplicates?

    What I need to do is remove any duplicate values, but ALSO remove any values that have duplicates. Is there a way to do this? I know about the remove duplicates feature, but it doesn't give you the option to specify that you also want to remove the original values of the duplicates.

    Note: I can do this using the filter and sort feature or the advanced filter option, but I need another way to do this WITHOUT using any of the filter options.


    Example: If you have the the below list on the left including duplicates, I would need a way to get the list to the right of the 1st list which only includes values that don't have values which included duplicates from the list on the left.

    1 1
    2
    2
    3 3
    4 4
    5
    5
    6 6
    7
    7
    8 8
    9
    9
    10 10


    Any thoughts?
    Last edited by bachfantasia; 05-12-2014 at 07:25 PM.

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to remove duplicates AND values that have duplicates?

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    will give the results as you have listed them.

    If you need them listed without spaces, in the next column enter:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The result will be:

    A
    B
    C
    1
    1
    1
    2
    2
    1
    3
    2
    3
    4
    3
    3
    4
    5
    4
    4
    6
    6
    5
    8
    7
    5
    10
    8
    6
    6
    9
    7
    10
    7
    11
    8
    8
    12
    9
    13
    9
    14
    10
    10
    Last edited by newdoverman; 05-13-2014 at 08:52 AM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to remove duplicates AND values that have duplicates?

    bachfantasia,

    If your raw data is in column A, beginning in cell A1 down, already sorted/grouped per your text display.

    The below macro will remove the duplicates plus the original, and, shift what is left up.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code
    2. Open your NEW workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the RemoveDuplicates macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  4. #4
    Registered User
    Join Date
    01-03-2014
    Location
    91362
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: How to remove duplicates AND values that have duplicates?

    .............................................

  5. #5
    Registered User
    Join Date
    01-03-2014
    Location
    91362
    MS-Off Ver
    Excel 2013
    Posts
    14

    Re: How to remove duplicates AND values that have duplicates?

    ................................................

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to remove duplicates AND values that have duplicates?

    bachfantasia,

    What is the meaning of ................................................ ?

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to remove duplicates AND values that have duplicates?

    This formula will reduce the list of values to only values that appear once in the list.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The result is:

    A
    B
    1
    1
    2
    2
    1
    3
    2
    3
    4
    3
    4
    5
    4
    6
    6
    5
    8
    7
    5
    10
    8
    6
    9
    7
    10
    7
    11
    8
    12
    9
    13
    9
    14
    10

  8. #8
    Registered User
    Join Date
    01-03-2014
    Location
    91362
    MS-Off Ver
    Excel 2013
    Posts
    14

    Thumbs up Re: How to remove duplicates AND values that have duplicates?

    Quote Originally Posted by newdoverman View Post
    This formula will reduce the list of values to only values that appear once in the list.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    The result is:

    A
    B
    1
    1
    2
    2
    1
    3
    2
    3
    4
    3
    4
    5
    4
    6
    6
    5
    8
    7
    5
    10
    8
    6
    9
    7
    10
    7
    11
    8
    12
    9
    13
    9
    14
    10
    Thank you kindly. This has been most helpful.

  9. #9
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: How to remove duplicates AND values that have duplicates?

    You're welcome.

  10. #10
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to remove duplicates AND values that have duplicates?

    bachfantasia,

    Did you even try my macro?

+ 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. [SOLVED] Remove duplicates and sum up their values
    By Ryan_Bernal in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-22-2013, 05:19 AM
  2. [SOLVED] Unique Values Without Remove Duplicates
    By Camel in forum Excel General
    Replies: 25
    Last Post: 07-20-2012, 04:17 AM
  3. Replies: 5
    Last Post: 02-28-2012, 02:52 PM
  4. Excel 2007 : return TXT Values and remove duplicates?
    By fordzilla in forum Excel General
    Replies: 0
    Last Post: 09-29-2011, 06:20 PM
  5. 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