#1   Report Post  
Posted to microsoft.public.excel.misc
chris
 
Posts: n/a
Default Delete Duplicate

I have an excel spreadsheet with the names of Companies in Column A and names
of Contacts in Column B, and additional contact information up to and
including Column H .

Can somebody give me a formula that will delete the entire row if the
company and the contact name are the same (A=B) and they are in the
spreadsheet more than once? Example:
Col A Col B
XYZ Company John Smith
XYZ Company John Smith
XYZ Company Jane Doe

In this example, I would like Row 1 to be deleted, and rows 2 and 3 to be
left in the database. Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Delete Duplicate

One way ..

Assuming source data is in sheet named: X,
cols A to H, from row1 down

Col A Col B
XYZ Company John Smith
XYZ Company John Smith
XYZ Company Jane Doe


In another sheet: Y (say),

Put in I1: =X!A1&"#"&X!B1
Put in J1: =IF(I1="#","",IF(COUNTIF($I$1:I1,I1)1,"",ROW()))
Select I1:J1, fill down to cover the extent of data in X

Put in A1:
=IF(ISERROR(SMALL($J:$J,ROW())),"",
INDEX(X!A:A,MATCH(SMALL($J:$J,ROW()),$J:$J,0)))
Copy A1 across to H1, fill down until blank rows appear,
signalling exhaustion of uniques data extracted from X

Freeze the values by selecting cols A to H, then do an "in-place":
Copy Paste special check "Values" OK
Delete cols I & J to clean up
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"chris" wrote in message
...
I have an excel spreadsheet with the names of Companies in Column A and

names
of Contacts in Column B, and additional contact information up to and
including Column H .

Can somebody give me a formula that will delete the entire row if the
company and the contact name are the same (A=B) and they are in the
spreadsheet more than once? Example:
Col A Col B
XYZ Company John Smith
XYZ Company John Smith
XYZ Company Jane Doe

In this example, I would like Row 1 to be deleted, and rows 2 and 3 to be
left in the database. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
Max
 
Posts: n/a
Default Delete Duplicate

Freeze the values by selecting cols A to H, then do an "in-place":
Copy Paste special check "Values" OK
Delete cols I & J to clean up


The last 3 lines above is of course, optional <g
The formulas set-up would auto-return unique lines from X into Y
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---


  #4   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Delete Duplicate

I'd add two helper columns:

In C1, I'd put:
=a1&char(10)&b1
and drag down

In D1, I'd put:
=countif(c:c,c1)
and drag down

Now apply data|filter|autofilter to column D.

Show the cells that are larger than 1

Delete those visible rows.

Delete columns C and D.


chris wrote:

I have an excel spreadsheet with the names of Companies in Column A and names
of Contacts in Column B, and additional contact information up to and
including Column H .

Can somebody give me a formula that will delete the entire row if the
company and the contact name are the same (A=B) and they are in the
spreadsheet more than once? Example:
Col A Col B
XYZ Company John Smith
XYZ Company John Smith
XYZ Company Jane Doe

In this example, I would like Row 1 to be deleted, and rows 2 and 3 to be
left in the database. Thanks


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
delete duplicate record but only determine 1 column data AskExcel Excel Worksheet Functions 3 January 28th 06 01:11 PM
Function to find duplicate values, then delete Cam Excel Worksheet Functions 1 January 27th 06 01:38 AM
How do I find duplicate rows in a list in Excel, and not delete it Matthew in FL Excel Discussion (Misc queries) 2 June 15th 05 09:11 PM
How to delete duplicate rows in Excel 2000? PAL@Emory Excel Discussion (Misc queries) 1 January 28th 05 03:08 PM
How to delete duplicate records when I merge two lists (deleting . rinks Excel Worksheet Functions 10 December 11th 04 01:03 AM


All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"