Using "OR" in an IF statement

I am trying to use the command OR in an If statement and I am having no luck. 
 In Lotus 123 I could string commands by using #OR# to produce a common 
result.  For example: =IF(J3="INVEST" #OR# IF(K3 = "INVEST",1,"NO"))  I can't 
seem to make this work in Excel.  Can anyone provide me with a correction?
0
Utf
3/8/2010 2:54:01 PM
excel.worksheet.functions 4936 articles. 2 followers. Follow

6 Replies
970 Views

Similar Articles

[PageSpeed] 46

Doug,

Like this

=IF(OR(J3="Invest",K3="Invest"),"The true condition","the false condition")

If the true or false condition is numeric then drop the quotes

-- 
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that 
introduces the fewest assumptions while still sufficiently answering the 
question.


"Doug" wrote:

> I am trying to use the command OR in an If statement and I am having no luck. 
>  In Lotus 123 I could string commands by using #OR# to produce a common 
> result.  For example: =IF(J3="INVEST" #OR# IF(K3 = "INVEST",1,"NO"))  I can't 
> seem to make this work in Excel.  Can anyone provide me with a correction?
0
Utf
3/8/2010 2:59:02 PM
="The "&LOWER(OR(J3="Invest",K3="Invest"))&" condition" :-)

-- 

HTH

Bob

"Mike H" <MikeH@discussions.microsoft.com> wrote in message 
news:D20576A2-4189-4F07-A440-C6F71AEC05F7@microsoft.com...
> Doug,
>
> Like this
>
> =IF(OR(J3="Invest",K3="Invest"),"The true condition","the false 
> condition")
>
> If the true or false condition is numeric then drop the quotes
>
> -- 
> Mike
>
> When competing hypotheses are otherwise equal, adopt the hypothesis that
> introduces the fewest assumptions while still sufficiently answering the
> question.
>
>
> "Doug" wrote:
>
>> I am trying to use the command OR in an If statement and I am having no 
>> luck.
>>  In Lotus 123 I could string commands by using #OR# to produce a common
>> result.  For example: =IF(J3="INVEST" #OR# IF(K3 = "INVEST",1,"NO"))  I 
>> can't
>> seem to make this work in Excel.  Can anyone provide me with a 
>> correction? 


0
Bob
3/8/2010 3:29:40 PM
=SIGN(COUNTIF(J3:K3,"invest"))


"Doug" wrote:

> I am trying to use the command OR in an If statement and I am having no luck. 
>  In Lotus 123 I could string commands by using #OR# to produce a common 
> result.  For example: =IF(J3="INVEST" #OR# IF(K3 = "INVEST",1,"NO"))  I can't 
> seem to make this work in Excel.  Can anyone provide me with a correction?
0
Utf
3/8/2010 4:23:02 PM
Or with 'invest' in J3 or k3

="You could have miscon"&LOWER(OR(J3="Invest",K3="Invest"))&"d my advice to 
the OP"

:)
-- 
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that 
introduces the fewest assumptions while still sufficiently answering the 
question.


"Bob Phillips" wrote:

> ="The "&LOWER(OR(J3="Invest",K3="Invest"))&" condition" :-)
> 
> -- 
> 
> HTH
> 
> Bob
> 
> "Mike H" <MikeH@discussions.microsoft.com> wrote in message 
> news:D20576A2-4189-4F07-A440-C6F71AEC05F7@microsoft.com...
> > Doug,
> >
> > Like this
> >
> > =IF(OR(J3="Invest",K3="Invest"),"The true condition","the false 
> > condition")
> >
> > If the true or false condition is numeric then drop the quotes
> >
> > -- 
> > Mike
> >
> > When competing hypotheses are otherwise equal, adopt the hypothesis that
> > introduces the fewest assumptions while still sufficiently answering the
> > question.
> >
> >
> > "Doug" wrote:
> >
> >> I am trying to use the command OR in an If statement and I am having no 
> >> luck.
> >>  In Lotus 123 I could string commands by using #OR# to produce a common
> >> result.  For example: =IF(J3="INVEST" #OR# IF(K3 = "INVEST",1,"NO"))  I 
> >> can't
> >> seem to make this work in Excel.  Can anyone provide me with a 
> >> correction? 
> 
> 
> .
> 
0
Utf
3/8/2010 4:32:01 PM
Miscontrued?

-- 

HTH

Bob

"Mike H" <MikeH@discussions.microsoft.com> wrote in message 
news:441E6DA5-3885-42AA-AD4D-924288C15AE7@microsoft.com...
> Or with 'invest' in J3 or k3
>
> ="You could have miscon"&LOWER(OR(J3="Invest",K3="Invest"))&"d my advice 
> to
> the OP"
>
> :)
> -- 
> Mike
>
> When competing hypotheses are otherwise equal, adopt the hypothesis that
> introduces the fewest assumptions while still sufficiently answering the
> question.
>
>
> "Bob Phillips" wrote:
>
>> ="The "&LOWER(OR(J3="Invest",K3="Invest"))&" condition" :-)
>>
>> -- 
>>
>> HTH
>>
>> Bob
>>
>> "Mike H" <MikeH@discussions.microsoft.com> wrote in message
>> news:D20576A2-4189-4F07-A440-C6F71AEC05F7@microsoft.com...
>> > Doug,
>> >
>> > Like this
>> >
>> > =IF(OR(J3="Invest",K3="Invest"),"The true condition","the false
>> > condition")
>> >
>> > If the true or false condition is numeric then drop the quotes
>> >
>> > -- 
>> > Mike
>> >
>> > When competing hypotheses are otherwise equal, adopt the hypothesis 
>> > that
>> > introduces the fewest assumptions while still sufficiently answering 
>> > the
>> > question.
>> >
>> >
>> > "Doug" wrote:
>> >
>> >> I am trying to use the command OR in an If statement and I am having 
>> >> no
>> >> luck.
>> >>  In Lotus 123 I could string commands by using #OR# to produce a 
>> >> common
>> >> result.  For example: =IF(J3="INVEST" #OR# IF(K3 = "INVEST",1,"NO")) 
>> >> I
>> >> can't
>> >> seem to make this work in Excel.  Can anyone provide me with a
>> >> correction?
>>
>>
>> .
>> 


0
Bob
3/8/2010 6:34:39 PM
I knew you'd notice LOL
-- 
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that 
introduces the fewest assumptions while still sufficiently answering the 
question.


"Bob Phillips" wrote:

> Miscontrued?
> 
> -- 
> 
> HTH
> 
> Bob
> 
> "Mike H" <MikeH@discussions.microsoft.com> wrote in message 
> news:441E6DA5-3885-42AA-AD4D-924288C15AE7@microsoft.com...
> > Or with 'invest' in J3 or k3
> >
> > ="You could have miscon"&LOWER(OR(J3="Invest",K3="Invest"))&"d my advice 
> > to
> > the OP"
> >
> > :)
> > -- 
> > Mike
> >
> > When competing hypotheses are otherwise equal, adopt the hypothesis that
> > introduces the fewest assumptions while still sufficiently answering the
> > question.
> >
> >
> > "Bob Phillips" wrote:
> >
> >> ="The "&LOWER(OR(J3="Invest",K3="Invest"))&" condition" :-)
> >>
> >> -- 
> >>
> >> HTH
> >>
> >> Bob
> >>
> >> "Mike H" <MikeH@discussions.microsoft.com> wrote in message
> >> news:D20576A2-4189-4F07-A440-C6F71AEC05F7@microsoft.com...
> >> > Doug,
> >> >
> >> > Like this
> >> >
> >> > =IF(OR(J3="Invest",K3="Invest"),"The true condition","the false
> >> > condition")
> >> >
> >> > If the true or false condition is numeric then drop the quotes
> >> >
> >> > -- 
> >> > Mike
> >> >
> >> > When competing hypotheses are otherwise equal, adopt the hypothesis 
> >> > that
> >> > introduces the fewest assumptions while still sufficiently answering 
> >> > the
> >> > question.
> >> >
> >> >
> >> > "Doug" wrote:
> >> >
> >> >> I am trying to use the command OR in an If statement and I am having 
> >> >> no
> >> >> luck.
> >> >>  In Lotus 123 I could string commands by using #OR# to produce a 
> >> >> common
> >> >> result.  For example: =IF(J3="INVEST" #OR# IF(K3 = "INVEST",1,"NO")) 
> >> >> I
> >> >> can't
> >> >> seem to make this work in Excel.  Can anyone provide me with a
> >> >> correction?
> >>
> >>
> >> .
> >> 
> 
> 
> .
> 
0
Utf
3/8/2010 7:49:01 PM
Reply:

Similar Artilces:

Line charts using temperature and time factors
I want to create a line chart showing comparisons of heating and time. For example one item is held @ 30deg for 10secs then 100degs for 30secs while the comparison is plotted to show the difference. Help appreciated. try x-y scatter chart data-columnwise. Excelon_Ls <Excelon_Ls@discussions.microsoft.com> wrote in message news:6B9F5547-A35C-4272-9FDC-F2CE6122D783@microsoft.com... > I want to create a line chart showing comparisons of heating and time. For > example one item is held @ 30deg for 10secs then 100degs for 30secs while the > comparison is plotted to show the diff...

using forms
Vista Home Premium 32 / Outlook 2007 I have created some forms that used to work. No more. On selecting a form, I get "The form required to view this message cannot be displayed. Contact the administrator. To my knowledge, I am the administrator. This is a stand-alone PC in my residence. If I go to Manage User Accounts, it shows only 2 accounts - LastName Administrator and Guest. I have googled my problem and found references to FRMCACHE.DAT which I am told to delete and restart Outlook. Did that. Opened Outlook and tried to open a form. Same error. And FRMCACHE.DAT was not ...

I used Omsgclas.exe Utility and my contacts don't use then new form
I created a new form for contacts. I followed the three steps in the document How to Update Existing Items to Use a New Custom Form. I can click on Action and do new contact and the new form is used. I used Omsgclas.exe utility to change the message class of the contacts. It shows as changed. However, when I click on an old contact (previous to changing the form), A message form comes up (not the old contact form and not my new contact form). Anyone have any help how to get my new form pulled up for old messages? Note: I had a form with a ' in the name, I made a new form w...

FormulaR1C1 using variables
I want to do this but can't: ActiveCell.FormulaR1C1 = "=MyFunction(R[variable]C[variable])" What are my options? Try something like ActiveCell.FormulaR1C1 = _ "=MyFunction(R" & CStr(variable) & "C" & CStr(variable) & ")" Cordially, Chip Pearson Microsoft Most Valuable Professional, Excel, 1998 - 2010 Pearson Software Consulting, LLC www.cpearson.com On Wed, 21 Apr 2010 13:52:01 -0700, Cheah <Cheah@discussions.microsoft.com> wrote: >I want to do this but can't: > >ActiveCell.Fo...

Using lookup formula using more than one cell
I have a spreadsheet which lists clients by first name, last name, postcode and phone number - all in separate columns e.g. Andy Roberts M56 7HN 0161 428 3856 I have these all in one worksheets and in a named range called "Clients" On a separate worksheet (within the same workbook) I log all my enquiries. What I want to be able to do is type in to a cell the first name then in the next cell the last name and the following cells get populated with postcode and phone number based on BOTH of the first two cells by looking up the "Clients" range. I can get it...

Compile error using CTypedPtrList
Hi, I am having problems at compile time using the following line: CTypedPtrList<CPtrList, CString*> m_ClientList ; When compiled I get the following errors: emailcfgdlg.h(114) : error C2143: syntax error : missing ';' before '<' emailcfgdlg.h(114) : error C2501: 'CTypedPtrList' : missing storage-class or type specifiers emailcfgdlg.h(114) : error C2059: syntax error : '<' emailcfgdlg.h(114) : error C2238: unexpected token(s) preceding ';' I am using the version 6 of the compiler with SP5. Now I think this is something to do with the c...

Allow temporarily use of right click
I have made a databse in which I have disabled the right-click option. However, I have a form which opens reports, and I want to temporarily allow (only for the opened report) the right click option so the user can save and print the report. I have also no clue how to create a custom menu with only a few of the normal right-click options I hope my question is clear. Thanks -- Message posted via http://www.accessmonster.com "greeknl via AccessMonster.com" <u30909@uwe> wrote in message news:71abb764263d9@uwe... >I have made a databse in which I have disabled the right-c...

Using stationary when Word is used as the editor
Hello, I am having a problem with stationary when using word as the email editor. What is required is for a logo to be placed as a backgroun image in the top right hand corner. this works fine in outlook using this code: <HTML> <HEAD> <STYLE> BODY { font-family: Arial; font-size: 10pt; color: 000000; background-position: right top; background-repeat: no-repeat; background-image: url(Pic.jpg); } </STYLE> </HEAD> <BODY> </BODY> </HTML> However when Word is used as the email editor the background image is no longer placed in the top righ...

What do you use Excel for?
Just a general query really. Anybody willing to tell me what they use Excel for? Does anybody use it on a daily basis as part of the personal life? I'm not really looking for the reasons why people use it at the workplace, but why do people use it at home? Do you use it to manage your budgets etc???? Do you use it as a diary? Thanks in advance Excel is excellent for manipulating data. The uses are as wide as the imagination. There are people who use it to track the standings in a bowling league, others for managing a local golf tournament. One can build a loan calculator, kee...

Use Vista to restore windows mail from backup
I use Vista 32bit backup to backup my computer. Vista 32 bit backup is not a disk image backup. I will be reinstalling everything on my computer. I use Vista Windows Mail that came with my computer for my email. How do I use Vista restore from my latest backup to restore my emails and contacts and email accounts POP/SMTP settings? I assume Vista 32 bit backup backs this up. Vista help does not specifically address this. Thank You for your Help. Bob Background info: I have a desktop AMD 4400+ 64X2 4GB memory 320GB HD(way bigger than I need) Acer computer (AM3100-U3201A) I...

Display in same cell lbs(kgs) using formula to auto-convert lbs
I would like to have a cell show #lbs(#kgs) in that format. But have the kgs measurement autoconvert from the entered lbs number. So the formula would look something like this Xlbs(Ykgs=X*0.454). I would also similarily like to have a #in(#cm) cell setup but I am guessing it would resemble the prescribed solution formula and only differ in the multipied conversion number. Thanks. Do you want the input and display in the same cell? You won't be able to do that without VBA. But if you input a number in A1, e.g. 25 you can make B1 display 25lbs(11.35kgs) with a formula like =A1&&...

Using Header on Multiple Worksheets
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel How am I able to get a Header so that it repeats on every worksheet within my document? <br><br>I have seen this question posted multiple times but have yet to see a solution that actually works for me. On 5/4/10 2:10 PM, MelaniePPC@officeformac.com wrote: > Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel > How am I able to get a Header so that it repeats on every worksheet > within my document? > > I have seen this question posted multiple times but have yet...

USING IGNORE BLANKS IN FORMULA
Hi, I want to use the following formula at the bottom of a column of inputs: =IF((D14+D15)>1,((D14+D15)/-2),"")+IF((D16+D17)>1,((D16+D17)/-2),"") etc. etc. This formula makes sure that if various cell entries in a column are at least 2 items in that cell, they will be counted as two per package plus a fraction (thus the divisor /-2). As long as a) the sum of the cells is at least two and b) there are no blank cells, the formula works. If however, one of the cells is blank and the total is less than 2 an error message occurs #value! . I have tried using I...

using outlook for email
I have windows xp and also office 200 premium.however, when i try sending an email while using explorer, i receive a message that reads "either there is no default mail client or current client cannot fulfill messaging request.Please run outlook and set it as the default mail client. I use AOL and have no problem sending email when i use it, however, when i use explorer i can't. is there a way i can set it up to be able to send an email? do i always have to open aol to send one? also, i have no idea how to configure it.also, when i try to set outlokk up, it asks for a postof...

Discrepancy in storage used.
When I do a backup of my Ex Svr 5.5 Sp4 Server the log shows 9.5 MB used by the Directory and 10.6 Gig used by Information Store. I'm not on Enterprise version so I'm coming up on the 16 Gig limit. However, when I look in Ex Svr Admin I can't account for all that space being used. Adding up all the mailboxes shows 3.6 Gig in use and the Public Folders shows 3.9 Gig used. That's 7.5 Gig total. The actual files Priv shows 5.9 Gig and Pub shows 4.4 Gig. To me this looks like ate least 2 Gig somewhere that I can't account for. That space would sure give me some breathing...

Using Forms for Input
Thanks in advance for the feedback. I have VBA form that I've created to display data to the screen using the following code (code only shows of few of the columns of data being loaded to form). Public Sub LoadLongInfo3(ByVal selectedProject As String) Dim databaseRow As Long Set reportsSheet = Sheets("Reports") Set resultsSheet = Sheets("Results") Set devdataSheet = Sheets("DevData") 'Find DataRows To Be Loaded Into Form devdataSheet.Activate devdataSheet.Cells.Find(What:=selectedProject, After:=devdataSheet.Cell...

WMI to use or not to use
(1)What is the downside of using WMI? (2)Can I distribute the MS WMICORE or just suggest a user download WMI for Win not having WMI like Win98 etc? I would like to use some WMI calls in my VB6 App. Specifically to get Serial Port information. (3) If not WMI, then what APIs will give me Serial Port info? (4)How do I check for WMI other that error trapping in a wrapper? "Bee" <Bee@discussions.microsoft.com> wrote in message news:37F39B6C-F47C-42B5-A79E-4654D2520502@microsoft.com... | (1)What is the downside of using WMI? | (2)Can I distribute the MS WMICORE or ...

Excessive memory use
I have a problem running Excel 2007 on a laptop with Windows Vista. Any time I work with a file of any substantial size, the program repeatedly freezes up. Windows Task Manager shows that Excel is using all the available CPU, even though I'm not performing any tasks. This may go on for 2-3 minutes or more, then I have a few seconds to try and do some work in the file before it freezes up again for another 2-3 minutes. This is extremely aggravating - I'm spending hours doing what should take minutes! The file I'm working on has about 15 sheets of 10,000 records each with abou...

Using VBA to send Word document as body of message works in 2007, but not in 2003
Based on Sue Mosher's code at http://www.outlookcode.com/codedetail.aspx?id=1333, the following code, which is located inside a With ActiveDocument - End With construction, works fine in Word 2007: Set objDoc = .MailEnvelope.Item With objDoc .To = strEmail .Subject = strSubject .Save strID = .EntryID End With Set objDoc = Nothing Set objDoc = ...

How do I configure Outlook to use a set email for a certain recipient
Hello, Is it possible to set Outlook 2003 in a way (either with rule or some other method) that it uses a set email address for a certain recipient? Let me clarify it. I have 2 different email accounts: one for work and for personal stuff. When I email to my friend -whose email address is stored in my address book - I want outlook to use my personal email address, even though my work email address is set as the default one. Is it possible with a rule, or some other way? I couldn't find any info on the net. Thanks, Zee Not in any current Outlook versions, no. --� Milly Staples [MVP ...

Import Statements
Hello, I just got Money 2005 Standard. I would like to import all my trades from Interactive Brokers into Money for the calender year 2004. I DL my monthly statments which have my trades. I estimate that I did about 15-20 trades each day. When I try to import the trades in, I am being asked to "Click Next to add this transaction to your Account Register." Is there a way to import without confirmation. This is taking too long. ...

With port is the Email router using???
Hey where can I find what the Email router realy do in proposion to the Exchange Server. In the implementation guide I cant find it. I dont know wich port the email-router is using if I will install it. Can anybody give me a link where I can read more detailed information about the configuration form the Email-router in Exhange? If you are referring to the port that is used to communicate bwteen the CRM Server & the Router, then it uses the standard web port (80 by default) but that could be different depending on how you installed CRM & Exchange. Matt Parks MVP - Microsoft CRM ...

to use or not to use sqldatasource
I am a newbie at this so I am spending time at night learning all I can of asp.net. I read the information on line plus in books and they make reference to sqldatasource. They also make reference to coding the connection, etc in C# in the code behind. I have a connection string in the webconfig file but my question pertains to the way to use it. It is getting confusing. What is the proper / best way to work with connection strings and all that goes it (da, dt, ds, etc), use a sqldatasource or thru code behind or both? And why? Thanks...John On Jan 30, 3:55=A0am, JohnE ...

Use other delimiter for a file in Excel
Hi, I need to use the "|" as a delimiter of a file created en Excel, bu when I tried to save it, only lets me save it like "separated wit tabs", "separated with comas", "separated with spaces", but doesn�t le me choose the separator I want, could you tell what to do? Thank -- Message posted from http://www.ExcelForum.com Temporarily change the regional setting in the windows control panel from comma to | then save the file as csv -- Regards, Peo Sjoblom "mcastillo >" <<mcastillo.12i9yf@excelforum-nospam.com> wrote in messag...

Import bank statement from the web
I have entered all my recurring bills in the Bills & Deposits section. Also I'm importing my bank statements via online banking. Is there a way within Money to match the two so I don't get double entries in my account register? Thanks for your help. Ferry Ferry, You use the Bills & Deposits screen to enter the transactions into the register. Then you downlod. Then you match the downloaded transaction to the transaction entered from the Bills & Deposits screen. Brian "Ferry" <ferry_slotboom@hotmail.com> wrote in message news:A2ANa.1372$cg3.984@news...