+ Reply to Thread
Results 1 to 6 of 6

Removing Duplicates Complication

  1. #1
    Registered User
    Join Date
    07-04-2016
    Location
    Melbourne, Australia
    MS-Off Ver
    Microsoft 365 MSO Version 2208 Build 16.0.15601.20764 64-bit
    Posts
    25

    Removing Duplicates Complication

    Hi there,

    I have a list of data in the following format and need to remove duplicates. An example is below:

    ID: Status:
    abc123 True
    abc123 True
    abc123 False
    DFG123 True
    DFG123 False
    DFG123 True
    QWE456 True
    QWE456 True

    So what I need is to remove all the duplicates from ID across the data set but in situations where there is a false within the status, I need to keep that and remove the trues. Example the first ID "abc123", I need to remove the two with true and leave the false. Whereas other duplicate ID's with only a True status, I'd just need to remove the dupes as per normal.

    Appreciate any help!

    Thanks,
    Mike

  2. #2
    Forum Expert
    Join Date
    11-28-2012
    Location
    Guatemala
    MS-Off Ver
    Excel 2010
    Posts
    2,394

    Re: Removing Duplicates Complication

    Try the example

    Macro consists in 3 basic sections

    Sort the data with column A and then column B (taking advantage that FALSE precedes TRUE)

    Clear the output area columns D & E

    Test each row for duplicates and only write it in column D if unique
    Attached Files Attached Files

  3. #3
    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: Removing Duplicates Complication

    See how this formula does with your live data.

    Assuming data is in A2:B9 this in C2 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Row\Col
    A
    B
    C
    1
    ID: Status:
    2
    abc123
    TRUE
    3
    abc123
    TRUE
    4
    abc123
    FALSE
    abc123
    5
    DFG123
    TRUE
    6
    DFG123
    FALSE
    DFG123
    7
    DFG123
    TRUE
    8
    QWE456
    TRUE
    QWE456
    9
    QWE456
    TRUE
    Dave

  4. #4
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Removing Duplicates Complication

    To do it with a formula try this: If ID is in column A with a heading in A1 and data starting from A2 and Status is in column B with a heading in B1 and data starting from B2, put this in C2 and drag it down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If the status is True and there is a False for the same ID it will show 'Remove'. For the first unique ID and status it will show 'Unique', and for the duplicates it will show 'Duplicate'. You can then filter by column C for just the unique entries.
    Please add reputation by clicking on the * if I have helped.
    Please mark the thread SOLVED if your issue has been resolved.
    Thanks, Glenn.

  5. #5
    Registered User
    Join Date
    07-04-2016
    Location
    Melbourne, Australia
    MS-Off Ver
    Microsoft 365 MSO Version 2208 Build 16.0.15601.20764 64-bit
    Posts
    25

    Re: Removing Duplicates Complication

    Thanks to all 3 of you!! Amazing help, appreciate it

  6. #6
    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: Removing Duplicates Complication

    You're welcome. Thanks for the feedback, and welcome to the forum.

+ 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] Copying from one sheet to another with complication
    By tony7262 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-26-2016, 11:19 AM
  2. Remove duplicates function not removing duplicates
    By Berilium2 in forum Excel General
    Replies: 3
    Last Post: 04-01-2015, 06:55 AM
  3. [SOLVED] Referencing a cell complication
    By trainerwatts3 in forum Excel General
    Replies: 4
    Last Post: 10-31-2014, 09:59 AM
  4. [SOLVED] Conditional Formatting Complication
    By Graphic Allen in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-03-2014, 10:41 AM
  5. Removing Duplicates
    By controlfreak in forum Excel General
    Replies: 7
    Last Post: 05-03-2012, 09:29 AM
  6. Replies: 6
    Last Post: 03-29-2012, 12:16 AM
  7. Get:Removing Duplicates
    By Gary's Student in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 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