Forum

Notifications
Clear all

Deleting a row with duplicate values

3 Posts
2 Users
0 Reactions
73 Views
(@tborg51)
Posts: 5
Active Member
Topic starter
 

Suppose I have an Excel sheet that looks like this:

ADVISOR # ADVISOR NAME CUSTOMER
123 Steve Rose B
123 Steve Anne W
123 Steve Ralph M
456 Steve Charles R
456 Steve Adelaide A
456 Steve Julian R
456 Steve Cathy D
456 Stephen Isabella B
789 Clay Stephen C
789 Clay Beth B
1011 Robert Carolyn M
1011 Robert Sharon P
1011 Robert Jill H
1011 Robert Marissa C
1011 Robert Sharon P
1011 Robert Staci H
1011 Robert Elizabeth H
1213 Daniel Gia B
1415 Richard Debra S
1415 Richard Maureen D
1617 Timothy Beverly K
1617 Timothy Charles R
1819 Bryan Deborah M
1819 Bryan Jeremy R

 

What I want to do is have a formula or macro that will look at the Advisor # in column A, then look at the customer name in column C.  If the name in column C is a duplicate (in red in my example), AND the Advisor # is the same for that customer, then delete the row for one of the duplicates (the second entry would be preferred, as it occurred later in time – there are several other columns, including a date column).  If the advisor number is DIFFERENT for a duplicate customer, then do nothing.

So in my example above, the row with the 2nd Sharon P would be deleted, but the row with the 2nd Charles R would be ignored.  My original data set will have 20,000 rows or more.

Can you help?

 
Posted : 12/09/2018 1:07 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Tom

Excel has a remove duplicate option.

From the Data tab select Remove Duplicates, untick Advisor Name and click OK.

Hope this helps.

Sunny

 
Posted : 12/09/2018 7:10 pm
(@tborg51)
Posts: 5
Active Member
Topic starter
 

Perfect, thanks!

 
Posted : 13/09/2018 9:51 am
Share: