how do i setup IF name = this then address = that

F

frederick

hello, i would like to set up something like this: if name = a then address =
x, if name = b then address = y,....
i work with 2 sheets, 1 for invoices 1 for contents or datas
 
G

G-fer

Hi Frederick ...

What are you trying to do here? Are you trying to give an individua
cell an instruction to do something according to what the value o
another cell is? For example, are you trying to automatically fil
cell A2 with the address of the person who's name appears in A1?

G'fe
 
D

Dave Peterson

If you have lots of names, it may be better to create a 2 column table on
another sheet (and hide that sheet???).

Then you could use this kind of formula:

=if(a1="","",vlookup(a1,sheet2!a:b,2,false))

And to avoid looking at errors when there isn't a match:

=if(a1="","",if(iserror(vlookup(a1,sheet2!a:b,2,false)),"Missing Name",
vlookup(a1,sheet2!a:b,2,false)))

Debra Dalgleish has lots of notes on =vlookup():
http://www.contextures.com/xlFunctions02.html
 
R

Ron Rosenfeld

hello, i would like to set up something like this: if name = a then address =
x, if name = b then address = y,....
i work with 2 sheets, 1 for invoices 1 for contents or datas

Set up a table and use VLOOKUP
--ron
 
F

frederick

exactly, pb i am real novice in excel, so f.e when i try with 1value it works
well but as long as i try to put more values it just wont work
=IF(I5="Frederick";Products!I3;Products!I6) works
=IF(I5="Frederick","Karim";Products!I3;Products!I6)
 
M

mr_teacher

If you only have a few exampls where you want to look this up you coul
use the OR command. In your example here it would be

=IF(or(I5="Frederick",I5="Karim"),Products!I3,Products!I6)

With this is I5 = Frederick or I5 = Karim then it will show the valu
for Products!I3, if it does not equal either if these values then i
will display the value in Products!I6

You can also nest many OR commands within these brackets.

If what you are looking for is to be able to display different result
depending on the input in I5 then you would probably need to se
VLOOKUP command which woul be along the lines of

=vlookup(I5,"Range","Column",FALSE)

If this is what you need then post again with a little bit more inf
about the data you have and what you are trying to find.

Hope this helps

Regards
 
Top