Nesting conditions together.

I

Ivan Koh

Hi all,

Another question on excel, how do i nest conditions together for AND, OR and
NOT.

So far, what i have is

=IF (OR('A'!A1=X,'A'!A1=Y),'A'!B1,"") which means that if the field A1 has
either X or Y, 'A'B1 will be triggered. else, it'll stay blank.

My problem comes with if A1 has either X or (Y and on top of Y, field C1 is
NOT blank) then 'A'B1 will be triggered. else, it stays blank.

Anyone with any idea on how to make that work?

Thanks

Ivan
 
P

Pecoflyer

Hi

Maybe
=IF (OR('A'!A1=X,AND('A'!A1=Y,'a'!c1<>"")),'A'!B1,"")


HTH said:
Hi all,

Another question on excel, how do i nest conditions together for AND,
OR and
NOT.

So far, what i have is

=IF (OR('A'!A1=X,'A'!A1=Y),'A'!B1,"") which means that if the field A1
has
either X or Y, 'A'B1 will be triggered. else, it'll stay blank.

My problem comes with if A1 has either X or (Y and on top of Y, field
C1 is
NOT blank) then 'A'B1 will be triggered. else, it stays blank.

Anyone with any idea on how to make that work?

Thanks

Ivan
 
J

Jacob Skaria

Try this.

=IF(OR('A'!A1=X,AND('A'!A1=Y,'A'!C1<>"")),'A'!B1,"")

If "x" and "y" are values...
=IF(OR(A1="X",AND(A1="Y",C1<>"")),B1,"")

If this post helps click Yes
 
J

JoeU2004

Ivan Koh said:
My problem comes with if A1 has either X or (Y and on top of Y,
field C1 is NOT blank) then 'A'B1 will be triggered. else, it stays
blank.

=if(AND(C1<>"",OR(A1=x,A1=y)), B1, "")

You can add the off-sheet syntax and replace "x" and "y" with appropriate
values.

A more obscure formulation:

=if((C1<>"")*((A1=x)+(A1=y)),B1,"")

Why would you ever do that? To reduce the number of nested functions, which
is limited to 7 (8 including the outermost function) in Excel 2003.


----- original message -----
 
J

JoeU2004

Errata....

I see from other responses that I probably have misunderstood your logical
intent. I agree with:

=if(or(A1=x,and(A1=y,C1<>""),B1,"")

or

=if((A1=x)+(A1=y)*(C1<>""),B1,"")


----- original message -----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top