+ Reply to Thread
Results 1 to 11 of 11

Remove duplicates

  1. #1
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2021 / 365
    Posts
    1,248

    Remove duplicates

    Hi,

    I am using the below code(extracted from internet)-
    Please Login or Register  to view this content.
    I think that it works fine for stacking/flattening data of multiple columns in multiple worksheet.
    Then I use the function
    Please Login or Register  to view this content.
    It then further gets sorted and alphabetically arranged in which there are duplicates but in different form.e.g

    A Grade Sun Korce P Ltd (605955053)
    A Grade Sun Korces [P] Ltd (605951053)

    A.G. He Ind (P) Ltd, Bhairaine (803459699)
    A.G. Hya Ind. (P) Ltd. (803459699)
    B & B International Trading (B.& B. International Trading Pvt.Ltd,Phara)
    Pace Maa Pack Ud 855656316 (855656316)
    Subhkamna Store
    Aakash Foods Products,(902844607)Kh (902844607)
    Aakash Foods Products,Kise (902844607)
    )

    What I want is that I want to retain only one.So,I want automatically to get one out of two. Duplicates is to be identified on the basis of number which matches irrespective of spelling mistake or typo in different sheet.

    How this can be done into a single function of vba or any other.
    Last edited by paradise2sr; 08-03-2022 at 02:02 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Remove duplicates

    I'd focus on this option
    Quote Originally Posted by paradise2sr View Post
    or any other.
    A good tool for it could be Power Query.
    At first I prepared a longer version (will give it below just for reference), but then the shorter:

    Please Login or Register  to view this content.
    Changed type step is important, as fuzzy logic will not work with non-text data.

    You can experiment with Threshold value. If this parameter is ommitted, (or equal default 0.8) then two last entries are not recognized as one, so I used lower one: 0.5 and for sample data is a good one.

    Both queries are used in attached file. And as said before, second (the one I started with) query for reference:
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by Kaper; 08-04-2022 at 05:10 AM. Reason: workbook attached
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Remove duplicates

    PS. And if needed, the list of removed duplicates could be obtained with similar query:
    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2021 / 365
    Posts
    1,248

    Re: Remove duplicates

    Thanx for the kind response. Actually ,I hesitate to use PQ as my data would be changing very frequently adding and deletion.And this result is linked to some other data.This kind of real life problem I am facing during data analysis.

    I would be please to let you know.
    Last edited by paradise2sr; 08-04-2022 at 09:34 AM.

  5. #5
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Remove duplicates

    Just a personal opinion:
    PQ is perfect for situation when data is "changing very frequently by adding and deletion"
    You (0r macro) change(s) data. Then either manualy right click on the table produced by PQ, select refresh Query and ... here it is. Or, to avoid right click and manual refresh, one couuld use an event handler for Worksheet_Change event to call refreshing. If you would like to focus on fuzzy match just in macro, you can google for fuzzy match cartesian product but the algorithms here are rather long (in terms of code), and (what's worse) quite computing power/time hungry and not so easy to implement. While PQ does it all almost in no time with just a little bit of code.
    Last edited by Kaper; 08-04-2022 at 09:55 AM.

  6. #6
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2021 / 365
    Posts
    1,248

    Re: Remove duplicates

    Hi,

    Thanx once again for your kind respose.

    Have you seen my another post at https://www.excelforum.com/excel-pro...lly-order.html

    The result seems as per your post #2 attachment seems to be fine but not tested on large data which I am dealing.I will test and let you know accordingly what problems I am facing.You can let me know the stepwise step for getting the result.

    Can you try in the sample workbook in the link stated.
    Last edited by paradise2sr; 08-05-2022 at 02:36 AM.

  7. #7
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2021 / 365
    Posts
    1,248

    Re: Remove duplicates

    I have duly tried in my actual large data but couldn't get it.

    I have a data in A2 as header and data in A3 & below.Pls let me know the required steps.Kindly note I have only one column and not two or three,so no append or merging could exists.Office 2021 using.

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Remove duplicates

    Make sure your data is in Excel table.

  9. #9
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Remove duplicates

    You may add an empty lina in row 1 of my file and copy your data into my file. And then just make sure the table (now starting in A2 extends down to end of your data

  10. #10
    Forum Contributor
    Join Date
    03-11-2011
    Location
    Nepal
    MS-Off Ver
    MS Excel 2021 / 365
    Posts
    1,248

    Re: Remove duplicates

    I just pasted data in A2 but doesn't seems to work if I refresh H and K column.I think results are in H column and K column.
    Plz elaborate in detail.

  11. #11
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Remove duplicates

    Unfortunately it is not easy to diagnose the problem if you do not show the file. It does not have to be real one. But something following the layout and format.
    Have you tried to right click on result table (green one) and choose "Refresh" from the pop-up context menu?

+ 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. Compare lists of URLs for duplicates, and remove duplicates
    By mrfranklin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-25-2021, 02:54 AM
  2. Replies: 6
    Last Post: 11-27-2018, 07:17 AM
  3. Replies: 6
    Last Post: 10-19-2018, 02:44 PM
  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