IF AND/OR Help!

ADoc01

New Member
Joined
Feb 13, 2020
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I've nested an if and/or formula and all seems to be working well except for one odd result.

I was wondering if someone could help. Attached is a screenshot.

TEST 4.JPG


The formula reads as follows for row 3: =IF(OR(AND(C3="B",D3="S"),AND(C3="S",D3="B"),AND(C3>0,D3<0),AND(C3<0,D3>0)),"TRADE","-")

If there is a B in the first column and an S in the other (same other way around), that should result in Trade.
If there is a positive number in the first column and a negative number in the next (same other way around) that should result in Trade.

The third row is generating Trade when I would like it not to.

If there is an "N" in either the first column or the second, then I would like to generate a "-".

Would someone be able to guide me as to how to nest this in the above formula?
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
The third row is generating Trade when I would like it not to.

Try this modification

=IF(OR(AND(C3="B",D3="S"),AND(C3="S",D3="B"),AND(ISNUMBER(C3),C3>0,D3<0),AND(C3<0,D3>0,ISNUMBER(D3))),"TRADE","-")
 
Upvote 0
You're welcome. Thanks for the follow-up. :)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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