View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default Finding duplicates in 2 worksheets

Put both datasets in MS Access. Let's call one Table1 and the other Table2.
Assuming the account# column is named AcctNum, use a query like this to get
duplicates:

Select T1.*
FROM Table1 T1
INNER JOIN Table2 T2
on T1.AcctNum = T2.AcctNum

These are all your duplicates

To get the remaining records from T1, the ones that are not duplicates, use
this query

Select T1.*
FROM Table1 T1
LEFT JOIN Table2 T2
on T1.AcctNum = T2.AcctNum
WHERE T2.AcctNum IS NULL






"darkwood" wrote:


I have 2 worksheets of data for a mailing list I'm doing. The first
worksheet has criteria pulled from one set of software and the other is
from a separate system. What I want to do is find which account numbers
from Sheet 2 appear on Sheet 1. Those that match get deleted from both
Sheet 1 and 2 put into a new worksheeet (Sheet 3), leaving me with no
duplicates in Sheet 1, and whatever is left in Sheet 2 is discarded.
I'll then use Sheet 1 for one mailing, and Sheet 3 for the other.

Any ideas?


--
darkwood
------------------------------------------------------------------------
darkwood's Profile: http://www.excelforum.com/member.php...o&userid=29948
View this thread: http://www.excelforum.com/showthread...hreadid=541624