+ Reply to Thread
Results 1 to 14 of 14

Delete original and duplicate

  1. #1
    Registered User
    Join Date
    01-17-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    5

    Delete original and duplicate

    We have a list of around 1800 products, and a separate list of 1600 of those that we have images for. I need to sort the data so that I just have a list of the 200 or so products we still require images for.

    I have no idea about macros, and would just like a simple formula that shows me all the duplicates (and their originals) and highlights to me the cells that do not have any duplicate.

    The closest I got was with conditional formatting and this changed the colour of the cells I was looking for. However, it did not work for any of the product codes we have which contain both numbers and text characters. Is there a way around this??

    I've attached the file in question for reference.

    Help would be great, been working on this at least 3 hours now...

    Many thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Delete original and duplicate

    Select Column-A>>Data Menu>>Data Tools>>Click Remove Duplicates>>Untick My Data Has headers>>Tick Column-A>>Click Ok


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Delete original and duplicate

    Hi and welcome to the forum

    Try his...
    1st, put this in B1 and copy down...
    =COUNTIF($A$1:$A$3188,A1)
    Then apply filters...Home tab/Editing/Sort and Filter/Filter
    Uncheck 1...OK
    delete what remains. If thats all you have, delete the row, not just the cell contents

    You canthen either take filters off, or check 1
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Delete original and duplicate

    The previous suggestion will keep the first entries and delete the duplicated data.

    The below formula will mark the duplicated records as delete and show the text Keep when it is present in a single time

    In B2 Cell

    =IF(COUNTIF(A:A,A1)>1,"Delete","Keep")

    Drag it down..

    Apply Auto filter for Column B and select Delete and delete the row

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,352

    Re: Delete original and duplicate

    Hi Horgans and welcome to the forum,

    I'd create a Helper Column and count how many of Col A are the same. Then I'd sort by this Helper Column to find the stuff you need.

    See the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Registered User
    Join Date
    01-17-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Delete original and duplicate

    Hi,

    I need to remove the originals as well, so just removing the duplicates won't work.

    FDibbins - I tried the formula you suggested (=COUNTIF($A$1:$A$3188,A1)) and it didn't seem to work once the product codes had numbers and letters. I've attached an image of this happening.

    Sixthsense - the same problem happened with your formula. Works until it reaches the cells with numbers and letters in.

    excelissue.jpg

  7. #7
    Registered User
    Join Date
    01-17-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Delete original and duplicate

    Same issue with the helper column!

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Delete original and duplicate

    all letters/all numbers/mixed letter and number...should not matter with that formula. It is counting duplicates, no matter what they are. check to see if you have training spaces?

    Please do not upload a picture of your file...rather, upload a sample of your workbook, showing what data you are working with, a few samples of your expected outcome is (manually entered is ok) and how you arrived at that. (exclude sensitive info). Pictures are pretty much impossible to edit, and no-one wants to re-type your data for you Also, not all members can upload picture files (Company firewalls and stuff)

  9. #9
    Registered User
    Join Date
    01-17-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Delete original and duplicate

    How do I check for training spaces? I'm using Outlook 2010, for reference,

    Thanks

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Delete original and duplicate

    oops I meant traiLing, sorry These are extra spaces at the end of text in a cell. Just by looking at the contents, you may not necessarily see them, but if you edit the cell and look in the formula bar, you will see that the cursor is 1 or more spaces away from the end of the text
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  11. #11
    Registered User
    Join Date
    01-17-2014
    Location
    Sydney
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Delete original and duplicate

    Thank you, I attached the file to my original post.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Delete original and duplicate

    This formula, copied down works just fine...
    =COUNTIF($A$1:$A$3188,A1)

    However, some of your data does indeed have trailing spaces. for example, look at the entries in A1187:A1189
    A1187="F071"
    A1188="F071 "
    A1189="F071 "

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: Delete original and duplicate

    1 way around this would be to create a helper column (I used C) and copy this down...
    =TRIM(A1)
    Then change the formula in B to this...
    =COUNTIF($C$1:$C$3188,C1)

  14. #14
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Delete original and duplicate

    I have not seen the OP's file just posting the below formula base on the FDibbins post #12 text

    =IF(TRIM(A1)="","",SUMPRODUCT(1*(TRIM($A$1:$A$3188)=TRIM(A1))))

+ 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] Deleting Duplicate and Original Rows
    By aferoz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-06-2022, 02:00 AM
  2. remove duplicate AND its original rows
    By TAX in forum Excel General
    Replies: 4
    Last Post: 03-29-2012, 02:12 AM
  3. Deleting duplicate numbers (both original and new ones)
    By zozoman in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2011, 04:06 PM
  4. Replies: 5
    Last Post: 06-14-2006, 07:10 PM
  5. Remove duplicate and original
    By Backdoor Cover in forum Excel General
    Replies: 4
    Last Post: 06-08-2006, 08:40 PM

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