A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with OR statement



 
 
Thread Tools Display Modes
  #1  
Old April 22nd, 2005, 02:56 PM
MrMike
external usenet poster
 
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,O37))),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  
Old April 22nd, 2005, 03:00 PM
Bob Phillips
external usenet poster
 
Posts: n/a
Default

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

perhaps?


--

HTH

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


"MrMike" wrote in message
news
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,O37))),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  
Old April 22nd, 2005, 05:00 PM
Duke Carey
external usenet poster
 
Posts: n/a
Default

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

or Bob's, with a slight change

=IF(O4=1,1,IF(AND(O4=7,O37),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,O37))),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!

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Statement created from ItemsSelected from Several Listboxes.. Denis Bisson Using Forms 2 February 21st, 2005 02:48 AM
Stop Statement Doesn't Stop drwip General Discussion 1 December 2nd, 2004 11:10 PM
Using Hyperlinks in Mail Merge IF...THEN...ELSE Statements Mark V Mailmerge 8 November 30th, 2004 01:31 PM
using the results of a SQL SELECT(COUNT) statement in VBA Paul James Using Forms 7 September 24th, 2004 09:44 PM
Access 2000 query SQL statement into VBA code Clint Running & Setting Up Queries 1 June 10th, 2004 01:33 PM


All times are GMT +1. The time now is 10:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.