#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 337
Default IF _ AND _ OR

I give up. I can't get the correct formula

If A1 =1 And A2 OR A3 =2 then A4 =4 otherwise A4 =""


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default IF _ AND _ OR

oldjay wrote:
I give up. I can't get the correct formula

If A1 =1 And A2 OR A3 =2 then A4 =4 otherwise A4 =""


Do be careful how you explain logical conundrums.

Strictly speaking, your question should be parsed as

If (A1 =1 And A2) OR A3 =2 then A4 =4 otherwise A4 =""

because AND takes precedence over OR.

Somehow I think you really meant

If A1 =1 And (A2 =2 OR A3 =2) then A4 =4 otherwise A4 =""

In which case I would write in A4:
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default IF _ AND _ OR

Try this:

=IF(AND(A1=1,OR(A2=2,A3=2)),4,"")

--
Biff
Microsoft Excel MVP


"oldjay" wrote in message
...
I give up. I can't get the correct formula

If A1 =1 And A2 OR A3 =2 then A4 =4 otherwise A4 =""




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 915
Default IF _ AND _ OR

smartin wrote:
oldjay wrote:
I give up. I can't get the correct formula

If A1 =1 And A2 OR A3 =2 then A4 =4 otherwise A4 =""


Do be careful how you explain logical conundrums.

Strictly speaking, your question should be parsed as

If (A1 =1 And A2) OR A3 =2 then A4 =4 otherwise A4 =""

because AND takes precedence over OR.

Somehow I think you really meant

If A1 =1 And (A2 =2 OR A3 =2) then A4 =4 otherwise A4 =""

In which case I would write in A4:


=IF(AND(A1=1,OR(A2=2,A3=2)),4,"")

Sorry about the cliff-hanger!
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 207
Default IF _ AND _ OR

oldjay,
Another solution:
"=IF(A1=1*AND(A2=2),4,IF(A1=1*AND(A3=2),4,"")) "
hth
:-)
"oldjay" wrote:

I give up. I can't get the correct formula

If A1 =1 And A2 OR A3 =2 then A4 =4 otherwise A4 =""




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default IF _ AND _ OR

Perhaps you could explain to us what the AND function does for you in that
formula?
In what way does 1*AND(A=2) differ from 1*(A=2) ?
--
David Biddulph

FloMM2 wrote:
oldjay,
Another solution:
"=IF(A1=1*AND(A2=2),4,IF(A1=1*AND(A3=2),4,"")) "
hth
:-)
"oldjay" wrote:

I give up. I can't get the correct formula

If A1 =1 And A2 OR A3 =2 then A4 =4 otherwise A4 =""



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



All times are GMT +1. The time now is 10:41 PM.

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"