IF OR statement help

F

Frustrated!!!

My name says it all!!
In Excel 2003 I am trying to get a third result from 2 other Y/N results.
What I need is:

Cell W4 needs to be R if:
I4 and J4 = Y
or
I4 = N and J4 = Y

I have tried other avenues and I'm hoping someone here can help.
 
J

JoeU2004

If I4 will contain only Y or N, you can do simply:

=if(J4="y","R","")

However, if you want to bullet-proof things, you can do:

=if(and(J4="y",or(I4="y",I4="n")),"R","")

Note: You do not mention what W4 should be if the condition for "R" is not
met. I have arbitrarily chosen a null string, which appears blank.


----- original message -----
 
F

Frustrated!!!

Thanks so much for that, formulas do my head in! Unfortunately I now realise
that I need to cover the other condition of:

or
I4=Y AND J4=N

Sorry to be a pain..
 
J

JoeU2004

Frustrated!!! said:
I now realise that I need to cover the other condition of:

or
I4=Y AND J4=N

I'm not sure I fully understand your requirement. Adding your previous
ones, are you now saying that you want W4 to be "R" if any of the following
conditions is met:

I4=y and J4=y
I4=y and J4=n
I4=n and J4=y

If so, and if I4 and J4 will only have Y or N, it seems that the only
condition when W4 should not be "R" is when I4=n and J4=n. Is that right?

If so, then:

=IF(AND(I4="n",J4="n"),"","R")

If you also want a null string result (not "R") when I4 or J4 is not Y or N,
then:

=IF(OR(AND(I4<>{"y","n"}),AND(J4<>{"y","n"}),AND(I4="n",J4="n")),"","R")


----- original message -----
 
T

T. Valko

Cell W4 needs to be R if:
I4 and J4 = Y
or
I4 = N and J4 = Y
or
I4=Y AND J4=N

Assuming the entries can only the be single letters Y or N.

=IF(OR(I4&J4={"YY","YN","NY"}),"R","")
 

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