Solved

Remove duplicates in Excel

Posted on 2011-09-12
8
264 Views
Last Modified: 2012-05-12
I have an Excel sheet with 18,000 rows, and 3 columns.  Column "B" is a first name field, Column "C" is a last name field.  I want to filter the duplicates from the sheet, but I need to filter by the first+last name fields.  I can only find a way to filter out the duplicates from one column at a time.  Any assistance would be appreciated.
0
Comment
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 10

Accepted Solution

by:
SANTABABY earned 500 total points
ID: 36524511
Choose any column (D or later) where you want to indicate whether the row is duplicate.
Say we choose D. In cell D1, enter the formula : =IF(COUNTIFS(B:B,$B1,C:C,$C1)>1,"X","")

Select the entire column D and paste.

Rows which have duplicated will be marked with 'X' in the corresponding column D cells.
0
 
LVL 8

Author Comment

by:Acosta Technology Services
ID: 36524690
I've entered that formula into D1, selected "D" to highlight the entire column, hit paste; and it stalled for a a few seconds but nothing happened.  I checked some of the cells that I can verify are duplicates and there is no entry in the "D" folumn.
0
 
LVL 9

Expert Comment

by:experts1
ID: 36524705
Do As follows:

(1) Add a new column
(2) This column will display first name / last name combination
(3) Enter formula in new column as follows:
  =B1 & " " & C1
  The above formula will concatenate (join)  the first and last names in this single column
  This assumes that the first row is number 1
(4) copy this formula to all 18,000 rows of the new column
(5) you should now be able to use this column to filter the duplicate rows as required.

Regards
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 8

Author Comment

by:Acosta Technology Services
ID: 36524736
Is there an easy way to copy the formula to all rows?  I think I'm missing something really easy here...
0
 
LVL 9

Expert Comment

by:experts1
ID: 36524863
Certailny,

Let us assume your new column is "D"

(1) select the first row with formula "D1"
(2) right click mouse and select COPY
(3) select the cell in the next row below "D2"  in same column
(4) scroll down to last row in column "D18000"
(5) Hold down SHIFT key, then select "D18000"
  At this point you should see column "D" Highlighted
(6) right click anywhere in column "D" and select PASTE

Note: important to hold SHIFT key before clicking on "D18000"

Result should be all 18000 rows now have UNIQUE formula for each row in column "D"

0
 
LVL 10

Expert Comment

by:SANTABABY
ID: 36524868
Could you please:
1. enter the formula in Cell D1
2. Select cell D1 and copy
3. Select cell D2 and the shift+select cell D18000 (to select the range).
4. Then paste.

Thanks.
0
 
LVL 50

Expert Comment

by:Ingeborg Hawighorst
ID: 36527031
Hello,

wouldn't it be much easier to use the Remove Duplicates button on the Data ribbon? For example in this data set


data      first      last
a      tom      blogg
b      tim      blogg
c      jack      blogg
d      joe      blogg
e      tom      blogg
f      tim      jones
g      jack      jones

Tom blogg is a duplicate, all others are unique. Click a cell in the data table, click "Remove Duplicates" in the Data ribbon, untick column A in the dialog and click OK. The result is


data      first      last
a      tom      blogg
b      tim      blogg
c      jack      blogg
d      joe      blogg
f      tim      jones
g      jack      jones

Five clicks, start to finish.

Try it out in the attached file.

cheers, teylyn
Book2.xlsx
0
 
LVL 8

Author Closing Comment

by:Acosta Technology Services
ID: 36530793
This solution allowed me to filter the duplicates by assigning the "X" value; at that point I was able to perform the csv export I needed without losing the data for the duplicates.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question