Vlookup ?

C

chum

Hi Folks,

I try to do the following:
I have 2 tables with one common column A (name), however the records
are not in the same range. I want to compare both tables and to get as
a result in a 3rd table: column A(name), column C(birthday) and column
B (city).
I think I should use vlookup function, I made some attempts but was not
successful yet. Could someone help me ?
It would be great !
thanks,


1st sheet :
column A(name) column B (age) column C(birthday)
george 25 1 may
dan 36 5 may
brian 42 18 may
rick 18 8 may
rene 29 14 april
david 31 23 march
jack 25 28 april

2nd sheet :
column A(name) column B(city)
george washington
rick new-york
rene london
jack berlin
david stuttgart
brian paris
dan roma
 
S

SteveG

Using your sample data. In Sheet3! column A, input your names. For the
birthday in B2 input the following:

=VLOOKUP(A2,Sheet1!$A$1:$C$8,3,FALSE)

Format your cells with a date format.

For the city in C2 input,

=VLOOKUP(A2,Sheet2!$A$1:$B$8,2,FALSE)


Does that help?

Steve
 
C

chum

Hi Steve,

thanks a lot, it works !

tell me if the 2nd list of names does not contain all records than the
1st list, do I need to beginn my formula with IF ?

thanks
Chum
 
S

SteveG

I assume you are getting an N/A error for those instances. To avoid
this change the formula to:

=IF(ISNA(VLOOKUP(A2,Sheet1!$A$1:$C$8,3,FALSE)),"Not In
List",VLOOKUP(A2,Sheet1!$A$1:$C$8,3,FALSE))

and

=IF(ISNA(VLOOKUP(A2,Sheet2!$A$1:$B$8,2,FALSE)),"Not In
List",VLOOKUP(A2,Sheet2!$A$1:$B$8,2,FALSE))

You can make it return whatever you want, I used Not In List as an
example.

HTH

Steve
 
Top