joining or merging data...

  • Thread starter Thread starter Naran Hirani
  • Start date Start date
N

Naran Hirani

Hi,

I need to do the following and am wondering if it is possible to
`join' or merge data from two sheets in a workbook. For example:
WS1 contains columns (A, B, C, D) and WS2 contains (E, F, C, G, H)

what I would like to do is generate a third sheet based on the values
contained in the common column `C' i.e. where the values match return:
A, B, C, D, E, F, G, H

in addition if the common column values don't match in the second sheet
then return A,B,C,D,'mismatch','mistmatch',...


Is this sort of thing possible using VBA, macros or whatever?

TIA.
Naran
 
Naran,

Yes, it is possible with VBA, if you know how (and not too
hard either, I would say...).
Yet, if you don't want to go that way, you could even do
it with plain worksheet functions! Try using EXACT
function in the condition of an IF function, something
like:
=If(exact(WS1!C2,WS2!C2),'WS1'!E2,"Mismatch")
in cell E2 in sheet WS3, and likewise for the rest of the
columns.

Note: your posting implies WS1 and WS2 have the same
number of rows...?

Good luck,

Nikos Y. (nyannaco at in dot gr)
 
Nikos,

Thanks for your reply. I don't know so I would try out your second
suggestion.

I think the data I will be working from is pretty nasty and so the
number of rows might not be the same. Do you think this is a major
problem?

Also, would there be any requirement to sort the data on the common
column in the two sheets invovled?

Cheers.
Naran.
 
Naran,

Different number of rows isn't necessarily a problem...
the formula will work anyway. It's just that I don't know
the nature of the data and the meaning of the comparison,
so I can't picture it!

No sorting required for the formula per se.

Nikos
 
Back
Top