ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   if/and formulas (https://www.excelbanter.com/excel-worksheet-functions/127781-if-formulas.html)

Chuckee

if/and formulas
 
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?

CLR

if/and formulas
 
One way............

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

hth
Vaya con Dios,
Chuck, CABGx3



"Chuckee" wrote:

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?


Pete_UK

if/and formulas
 
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


On Jan 25, 8:16 pm, Chuckee wrote:
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?



Ron Coderre

if/and formulas
 
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


"Chuckee" wrote:

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?


Elkar

if/and formulas
 
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


"Chuckee" wrote:

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?


driller

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

--
*****
birds of the same feather flock together..



"Chuckee" wrote:

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?


Chuckee

if/and formulas
 
Cheers Guys all the options work fine. Never used Lookup CLR but its a good
option

"Pete_UK" wrote:

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


On Jan 25, 8:16 pm, Chuckee wrote:
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?




Pete_UK

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

Pete

On Jan 25, 8:51 pm, driller wrote:
maybe we can do this way also
=IF((J1&K1="XG"),"AAAAA",IF((J1&K1="XT"),"BBBBB"," "))

--
*****
birds of the same feather flock together..



"Chuckee" wrote:
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?- Hide quoted text -- Show quoted text -




All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com