Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
MrMike
 
Posts: n/a
Default Help with OR statement

Hi. Currently I have the following Excel formula, which returns 2 if the
statement is TRUE and returns 0 if the statement is FALSE.

=if(Or(O4=1,(And(O4=7,O3<7))),2,0)

Is it possible to format this statement to return a 1 if the OR statement is
TRUE, but return a 2 if the AND statement is TRUE? Thanks!
  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=if(O4=1,1,IF(And(O4=7,O3<7))),2,0))

perhaps?


--

HTH

RP
(remove nothere from the email address if mailing direct)


"MrMike" wrote in message
...
Hi. Currently I have the following Excel formula, which returns 2 if the
statement is TRUE and returns 0 if the statement is FALSE.

=if(Or(O4=1,(And(O4=7,O3<7))),2,0)

Is it possible to format this statement to return a 1 if the OR statement

is
TRUE, but return a 2 if the AND statement is TRUE? Thanks!



  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

try
=1*(O4=1)+2*And(O4=7,O3<7)

or Bob's, with a slight change

=IF(O4=1,1,IF(AND(O4=7,O3<7),2,0))


"MrMike" wrote:

Hi. Currently I have the following Excel formula, which returns 2 if the
statement is TRUE and returns 0 if the statement is FALSE.

=if(Or(O4=1,(And(O4=7,O3<7))),2,0)

Is it possible to format this statement to return a 1 if the OR statement is
TRUE, but return a 2 if the AND statement is TRUE? Thanks!

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
How to calculate a sum as one outcome of an IF statement barb in NC Excel Worksheet Functions 2 March 31st 05 08:01 PM
What statement to use? Paul Excel Worksheet Functions 6 February 13th 05 05:23 PM
How do I fix a circular reference in a financial statement? drjayhawk25 Excel Discussion (Misc queries) 0 February 7th 05 05:19 PM
7+ nested if statement? Turi Excel Worksheet Functions 3 December 20th 04 07:55 PM
Statement lintan Excel Worksheet Functions 1 December 2nd 04 11:31 PM


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