View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Find Duplicates and Move to New Worksheet

"Adurr" wrote:
I need to create a formula or a Macro that compares data on one worksheet and
it compares it to another worksheet and if it finds a match moves it to a new
worksheet. I tried using the index and match functions but neither seem to
working very well for me. Can anyone help give me an example?


Try this sample from my archives which seems a good fit:
http://savefile.com/files/655843
Compare B vs A n filter exclusions in C.xls

As-is, the sample illustrates as titled, ie it'll compare values within a
key col in sheet: B with values within a corresponding key col in sheet: A,
then filters exclusions into a new sheet C. Exclusions are the lines in B not
found in A.

If you want it to return the converse in C, ie lines in B found in A,
just amend the criteria col as follows

In C,

As-is, the formula in A2 is:
=IF(B!A2="","",IF(ISNUMBER(MATCH(B!A2,A!A:A,0)),"" ,ROW()))

Just replace the criteria formula in A2 with:
=IF(B!A2="","",IF(ISNUMBER(MATCH(B!A2,A!A:A,0)),RO W(),""))
then copy down

(just do a simple swap of the ROW() & "" values to flag *matches* instead of
non-matches between the key cols in B vs A)

Cols B and C will now return the converse, ie lines in B found in A, all
neatly bunched at the top.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---