+ Reply to Thread
Results 1 to 12 of 12

Removing Duplicates

Hybrid View

  1. #1
    Registered User
    Join Date
    11-23-2014
    Location
    Wichita
    MS-Off Ver
    2007
    Posts
    17

    Removing Duplicates

    Is there a formula (or other way) to identify and remove both duplicates and the original value of a duplicate (found only in columns A and B)?
    I've attached an example of what I am working with.

    The end result would be the entire Row 6 and Row 7 (both have duplicates in column A and B) being deleted
    and entire Row 9 and Row 10 being deleted.

    Thanks in advance!Duplicates.xlsx

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Removing Duplicates

    =IF(OR(AND(A4=A3,B4=B3),A4=A5,B4=B5),"X","")
    In D4 and then copied down will populate the X's for you. If you're not bothered about the deletions being automated then filtering on X and delete will remove them.

    Note however, this formula will put an X in all 4 of the rows, whereas your original data only had it in the duplicated row, your blurb however states you want to delete all 4 rows. If you dont, and you only want to delete the duplicated entry ie rows 7 and 10 then use:
    =IF(AND(A4=A3,B4=B3),"X","")
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,730

    Re: Removing Duplicates

    Try .. in F4

    =IFERROR(INDEX(A$4:A$11,SMALL(IF(COUNTIF($A$4:$A$11,$A$4:$A$11)=1,ROW($A$4:$A$11)-ROW($A$4)+1,""),ROWS($A$4:A4))),"")

    Enter with Ctrl+Shift+ENTER

    Then copy across and down

  4. #4
    Registered User
    Join Date
    11-23-2014
    Location
    Wichita
    MS-Off Ver
    2007
    Posts
    17

    Re: Removing Duplicates

    Actually John,
    I need this to continue to work only if the first AND second column both contain the duplicates.
    The values in the first column can appear with different values in the second column and I would need them to appear in the formulated result.
    My error for attaching a poor example.
    Can this still be accomplished?

  5. #5
    Registered User
    Join Date
    11-23-2014
    Location
    Wichita
    MS-Off Ver
    2007
    Posts
    17

    Re: Removing Duplicates

    Thank you, PJWitfield, the first formula does help to accomplish what I am looking to do!

    However, is there any other way to get this result without the extra steps of filtering and manually deleting?

    Thanks

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2503
    Posts
    13,702

    Re: Removing Duplicates

    Quote Originally Posted by Kandy1084 View Post

    ....... However, is there any other way to get this result without the extra steps of filtering and manually deleting? ........
    Did you try JohnTopley's formula? It does that.
    Last edited by FlameRetired; 08-24-2015 at 11:22 PM.
    Dave

  7. #7
    Registered User
    Join Date
    08-22-2015
    Location
    Dhaka
    MS-Off Ver
    office 8
    Posts
    33

    Re: Removing Duplicates

    =IF(A4=A5,"X",IF(A4=A3,"X",""))

    u can use this simple formula in D column to get X's..

  8. #8
    Valued Forum Contributor
    Join Date
    04-27-2015
    Location
    Abu Dhabi, U.A.E
    MS-Off Ver
    Office 365 | 2016
    Posts
    697

    Re: Removing Duplicates

    Select the cells and use the "Remove Duplicates" option under "Data" Tab.

  9. #9
    Registered User
    Join Date
    11-23-2014
    Location
    Wichita
    MS-Off Ver
    2007
    Posts
    17

    Re: Removing Duplicates

    My apologies, John Topley is correct.
    I'm not sure what I did wrong the first time, but this works perfectly for me!
    Thanks for your help!

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,730

    Re: Removing Duplicates

    Try ...

    =IFERROR(INDEX(A$4:A$11,SMALL(IF(COUNTIFS($A$4:$A$11,$A$4:$A$11,$B$4:$B$11,$B$4:$B$11)=1,ROW($A$4:$A$11)-ROW($A$4)+1,""),ROWS($A$4:A4))),"")


    Enter with Ctrl+Shift+ENTER

    Then copy across and down

    You did state A and B in your original post so "mea culpa".
    Last edited by JohnTopley; 08-25-2015 at 11:41 AM.

  11. #11
    Registered User
    Join Date
    11-23-2014
    Location
    Wichita
    MS-Off Ver
    2007
    Posts
    17

    Re: Removing Duplicates

    Perfect, thanks so much!!

  12. #12
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,406

    Re: Removing Duplicates

    I offer a version without an array formula.
    Attached Files Attached Files

+ 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 function not removing duplicates
    By Berilium2 in forum Excel General
    Replies: 3
    Last Post: 04-01-2015, 06:55 AM
  2. removing duplicates
    By comp23 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-05-2012, 01:49 PM
  3. Replies: 6
    Last Post: 03-29-2012, 12:16 AM
  4. Removing duplicates
    By bouncey in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-11-2010, 03:25 PM
  5. Removing Duplicates
    By Gary's Student in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06: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