0

I'm using Excel in Microsoft 365 Apps for Enterprise.

I need to paste new rows in an already existing sheet, then remove duplicates according to the value of the first column (the "name"). To do this, I click Data -> Remove Duplicates, and then Under Columns, check the first column. Similar to this: Removing Duplicates in Excel

This works well; however, I need to make sure that the duplicates deleted are always the new ones, i.e. the ones I paste in the existing sheet. That is, if a newly pasted row already exists, it's that one that should be deleted.

I have done tests but I can't tell if this is always the case. I need to make sure that existing records are not lost.

4
  • You have to be able to sort it so the one you keep is on top. Remove duplicates will keep the first one it encounters going from top to bottom. So if your data has dates, then sort them ascending on the date field prior to using remove duplicates. If you do not have dates then insert the data in the top of the table instead of pasting on the bottom. Commented Jun 26, 2023 at 13:47
  • Thanks, your first 2 sentences confirm what I observed in the tests. However, your 3rd sentence is unclear, and your 4th sentence contradicts what you wrote before. Could you please clarify? Also, the sheet doesn't contain dates, and it would be irrelevant anyway because all I need to do is to filter according to the first column, which contains a text (the "name"). Please feel free to add this as an answer so I can upvote and accept it.
    – dr_
    Commented Jun 26, 2023 at 14:08
  • 1
    You wish to delete a row whenever a duplicate is pasted? This seems like a job for VBA.
    – harrymc
    Commented Jun 26, 2023 at 14:55
  • 1
    If you are putting your new rows below your existing rows, then those below would be the potential duplicates. A way you can reassure yourself is to add a blank row in between the existing rows and the new rows. When you remove duplicates you should see all rows above the blank row would remain, and only rows below that blank row would disappear (unless of course you had a duplicate in the existing data) Hope this helps.
    – gns100
    Commented Jun 27, 2023 at 0:03

0

You must log in to answer this question.

Browse other questions tagged .