IF Statement

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
 
G

Guest

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
 
R

Rick Rothstein \(MVP - VB\)

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
 

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