Formula help

markster

Well-known Member
Joined
May 23, 2002
Messages
579
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi there

Just need a bit of help with a formula. Basically use the following formula which is pretty straightforward:

=IF(I7<0,"OPEN","CLOSED")

But I need to add a further variable to add to the above formula that totally ignores the first bit of the formula and returns "Pending Stop" if cell C7 contains the term Sell Stop or Buy Stop

So if I7 <0 and cell C7 does not contain the words Sell Stop or Buy Stop it returns Open
So if I7 <0 and cell C7 does not contain the words Sell Stop or Buy Stop it returns Close

In the above scenarios if the cell C7 contains either Sell Stop or Buy Stop it returns Pending Order

Hope this is clear.

Thanks in advance.
Mark
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Unclear as these two lines are the same test:

So if I7 <0 and cell C7 does not contain the words Sell Stop or Buy Stop it returns Open
So if I7 <0 and cell C7 does not contain the words Sell Stop or Buy Stop it returns Close
 
Upvote 0
Unclear as these two lines are the same test:

So if I7 <0 and cell C7 does not contain the words Sell Stop or Buy Stop it returns Open
So if I7 <0 and cell C7 does not contain the words Sell Stop or Buy Stop it returns Close
Sorry the second one should be if I7>0 and Cell C7 does not contain the words Sell Stop or Buy Stop it returns Close
 
Upvote 0
Is this what you mean?
Code:
=IF(AND(I7<0,OR(C7<>"Sell Stop",C7<>"Buy Stop")),"Open","Close")
 
Upvote 0
Hi thanks for this - not quite. If C7 contains "Buy Stop" or "Sell Stop" it should override the other criteria and return "Pending Order" not "Open or Close"
Thanks again.
Mark
 
Upvote 0
Hi there again - any ideas? Just tried to amend the formula myself and just get an error.
Thanks again
Mark
 
Upvote 0

Forum statistics

Threads
1,214,598
Messages
6,120,441
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