#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Bob is offline
external usenet poster
 
Posts: 972
Default IF Statement

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

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



"bob" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default IF Statement

Try this:

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


"bob" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default IF Statement

Good one.
There's always someone who thinks outside the box. LOL



"Teethless mama" wrote:

Try this:

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


"bob" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,202
Default IF Statement

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?

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
IF Statement timmadge Excel Worksheet Functions 1 February 7th 06 05:42 PM
If Statement - Need Help streetboarder Excel Discussion (Misc queries) 8 February 5th 06 06:02 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 01:00 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"