Compounded If Or Statement

schmitkl

New Member
Joined
Feb 13, 2019
Messages
7
Good morning all! I need a formula that does the following:
If one cell is negative and the other is positive return NA, but if both are positive or both are negative D4 (for example)

I know it should be something along the below, but not sure how to write it to function properly. Thank you in advance!
If C4 < 0 and D4 > 0, or if C4 > 0 and D4 <0 return NA but if C4 <0 and D4 <0 or C4 > and D4 >0 return D4.
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How about
=IF(OR(AND(C4<0,D4<0),AND(C4>0,D4>0)),D4,"NA")
 
Upvote 0
Hi,

Please see below - I started with C2 and D2 but the gist is there:

Code:
=IF(C2<0,IF(D2<0,D2,"N/A"),IF(D2>=0,D2,"N/A"))

Please let me know if you need anything clarifying or it doesn't work (I tried for a set of data and seemed to work, but you never know).
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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