• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Remove Duplicates (but keep the one with an email contact!)?

NURDS

New Member
Hi everyone. I'm a new member based in the rainy north of England! I would consider myself as "outstandingly average" at Excel and have been using this site for years. For the first time, I have a problem that I can't fix without your specific help.

I have a list of our customers. I need to remove the duplicate customers (which, ordinarily is easily done using the duplicates function). However, I need remove all duplicates but keep the customer line that contains the email??

I have uploaded a sample file which hopefully illustrates the problem. As you will see, some customers have one email, some have more than one email and some have none. I just need to figure out how to keep one single line of each customer (if no email exists) and where an email exists, keep one line of data (containing an email contact)??

Hopefully this makes sense.
 

Attachments

  • SampleFile.xlsx
    8.3 KB · Views: 5
Last edited:
First do a straight Remove Duplicates on all 3 columns.
Then temporarily add this formula to cell D2:
=AND(COUNTIFS($A$2:$A$9,A2,$B$2:$B$9,B2)>1,ISBLANK(C2))
making sure that the ranges $A$2:$A$9 and $B$2:$B$9 cover your data.
All those with TRUE in column D can be deleted, so Autofilter the 4 columns, show only True in Column D, select the visible cells and either:
right-click and choose delete row and confirm you're happy to delete the entire rows of the sheet, or, if you think that's a bit dangerous,
press the delete key on the keyboard (which will leave blank rows on the sheet but you can always sort that range to put all the blank rows at the bottom).
Either way, remove the autofilter and delete the formulae in column D.

if a customer has more than one email address, all emails will remain.
 
Back
Top