IF Statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If D3 contains the string "pn" and if E3 contains either "m" or "a", I want
the value in I3 to be 1.

If D3 does not contain "pn" and E3 does not contain "M" or "A", I want I3 to
be zero.

Can someone provide a formula to do this?

Thanks very much,
Bob
 
Hi Bob, I'm not an expert, but this works when used in cell I3

=IF(AND(D3="pn",OR(E3="m",E3="n")),1,0)

I am assuming that you want both "pn" and either of M or N to be present.
Again, I'm just a user, perhaps an MVP will have an easier way.

Christine
 
If D3 contains the string "pn" and if E3 contains either "m" or "a", I
Try this:

=AND(D3="pn",OR(E3={"m","n"}))+0

I believe your formula can be tightened up a little bit more....

=(D3="pn")*OR(E3={"m","n"})

Rick
 
Back
Top