View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Comparing two sets of data

Perhaps this might help ..

Assume that the set-up you have in Sheets 1 and 2 are identical,
i.e. Lastname & Firstname in cols A and B, then Col3 to Col6's data
in col C to F, with data in row2 down
(The names are assumed unique in cols A and B)

In Sheet2
-----------
In say, col G
Put in G2: =TRIM(A2&" "&B2)
Copy G2 down as many rows as there is data

In Sheet1
-----------
Put in G2:

=IF(ISNA(MATCH(TRIM($A3&"
"&$B3),Sheet2!$G:$G,0)),"",OFFSET(Sheet2!$A$1,MATC H(TRIM($A3&"
"&$B3),Sheet2!$G:$G,0)-1,COLUMN()-5))

Copy G2 across to J2, then copy down as many rows as there is data

In cols G to J will be the corresponding data for the matched Lastname &
Firstname
extracted from Col3 to Col6 of Sheet2

Unmatched names will return blanks [""]

--
Rgds
Max
xl 97
--
Please respond, in newsgroup
xdemechanik <atyahoo<dotcom
---
"Eric G" wrote in message
...
I have a sheet with 600 records (LastName, FirstName, Col3, Col4,
Col5,Col6).
My second sheet has 670 records with the same field headings but the
data is different in Col3, Col4, Col5, Col6 for ALL the records.

Can someone please tell me how I can sort Sheet Two so that the first
600 records are arranged in the same order as Sheet One's (Last Name,
FirstName sort) ?

I hope this makes sense.

Thanks! Eric