#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default 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?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default 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?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default 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?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 964
Default 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?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 740
Default 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?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 14
Default 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?



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default 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 -


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"