What's wrong with this IF statement?

jasgot

New Member
Joined
Jul 16, 2002
Messages
30
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
Platform
  1. Windows
This doesn't work, how do I write it correctly?

If Range("b7").Value <> "Telephone Support" Or "Warranty Parts" Then


Thanks....
Jason
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
On 2002-07-26 10:12, jasgot wrote:
This doesn't work, how do I write it correctly?

If Range("b7").Value <> "Telephone Support" Or "Warranty Parts" Then


Thanks....
Jason


TRY THIS:
if(or(b7<>"Telephone Support", b7<>"Warranty Parts"),"Good","Bad")

HTH
texasalynn
 
Upvote 0
On 2002-07-26 10:12, jasgot wrote:
This doesn't work, how do I write it correctly?

If Range("b7").Value <> "Telephone Support" Or "Warranty Parts" Then


Thanks....
Jason

Try

If Range("b7").Value <> "Telephone Support" Or <> "Warranty Parts" Then

Regards,
 
Upvote 0
I've always had this problem, and have solved it by simply doing:

If Range("b7").Value<> "Telephone Support" Or Range("b7").Value<> "Warranty Parts" Then

So, you can't just string OR's on to the end, it has to be comparing directly.
This message was edited by OdinsDream on 2002-07-26 10:46
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,447
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top