if/and formulas

C

Chuckee

Hi,
Is it possible to nest if/and formulas or is there a different way to do it.
Here is my simple example

=IF(AND(J1="X", K1="G"), "AAAAA",""),IF(AND(J1="X", K1="T"),"BBBBB","")

Now this gives a #value! error

Any ideas?
 
C

CLR

One way............

=LOOKUP(J1&K1,{"","xg","xt"},{"","aaaaa","bbbbb"})

hth
Vaya con Dios,
Chuck, CABGx3
 
P

Pete_UK

I think you need to re-write it slightly:

=IF(AND(J1="X", K1="G"),"AAAAA",IF(AND(J1="X", K1="T"),"BBBBB",""))

Hope this helps.

Pete
 
R

Ron Coderre

Try one of these:

=IF(AND(J1="X", K1="G"), "AAAAA",IF(AND(J1="X", K1="T"),"BBBBB",""))
or
=IF(J1="X",IF(K1="G", "AAAAA",IF(K1="T","BBBBB","")))

Does that help?
***********
Regards,
Ron

XL2002, WinXP
 
E

Elkar

You're close, but you need to nest the second IF statment inside the False
condition of the first one. Like this:

=IF(AND(J1="X",K1="G"),"AAAAA",IF(AND(J1="X",K1="T"),"BBBBB",""))

HTH,
Elkar
 
D

driller

maybe we can do this way also
=IF((J1&K1="XG"),"AAAAA",IF((J1&K1="XT"),"BBBBB",""))
 
P

Pete_UK

J1 could contain "XG" and K1 is empty, and it would satisfy the first
condition, but not what the OP specified.

Pete
 
Top