Control Validation List

E

Ekser

Hi,

This is what i'm trying to do:

I have a Validation List for some of the cells in my report. Thos
lists are taken from another sheet, let's say sheet2 - F2:F7 wit
"names". Next to that list, I
have a phone number for each of the names in the next column - G2:F7.
Now, in my current Sheet 1 I display the "names" in cells C2:C30(singl
value per cell), and next to it (cellsD2:D30)I would like to have th
corresponding phone number (from sheet2). I have tried with some If
ElseIf statements, but it doesn't seem to work at all!

Here's my code in range D2:D30
=IF(C3=Sheet2!F2
Sheet2!G2,ElseIf(C3=Sheet2!F3,Sheet2!G3,ElseIf(Decembar04!C3=Sheet2!F4,Sheet2!G4,ElseIf(Decembar04!C3=Sheet2!F5,Sheet2!G5,ElseIf(Decembar04!C3=Sheet2!F6,Sheet2!G6,ElseIf(Decembar04!C3=Sheet2!F7,Sheet2!G7))))))


Any ideas
 
B

bcmiller

Looks like you need a vlookup to do the trick, eg:

=vlookup(c2,Sheet2!F2:G7,2,false)

Repeat this for each required entry on your sheet one and the jo
should be done.

NB: It would be smart to put some error checking on this to make sur
you workbook looks neat and professional (ie: ISERROR)

Cheers,

B
 
M

mzehr

Hi BC
You would probably want to make those references absolute:

=vlookup(c2,Sheet2!F$2:G$7,2,false)
 
Top