HELP!!! How to Nest AND OR functions PART II

B

bullandbear1987

Ok, so here was my original problem:

I am attempting to nest the and or functions.
I would like the argument to state:

IF C47 and D47 are negative... take the absolute value of g47/d47
IF C47 or D47 are negative.... take g47/c47+1
IF C47 and D47 are not negative... take g47/d47


Here is what i have written.... can someone please help?????? IT IS
GIVING ME ERRORS


=IF(AND(C47,0,d47<0),abs(g47/d47),OR(C47<0,D47<0),(G47/C47+1),(G47/D47))


---------------------------------------------------------------------------------------------------------------------------------------
We were able to fix that with:
=IF(AND(C47,0,d47<0),abs(g47/d47),IF(OR(C47<0,D47<0),(G47/C47+1),(G47/D47))



I have one more question.
What do I do to this argument if when d47 is negative but c47 is
positive, how can I add it so that if this is the case........ take
g47/d47

Here is what i wrote with error again

=IF(AND(C47<0,D47<0),ABS(G47/D47),IF((C47<0),G47/C47+1,G47/D47),IF((,D47<0),g47/d47+1,g47/d47))
 
M

Mika

fellow trader,

the general structure for nested if is:

if( cond1, do A, if(cond 2, do B, if (cond 3, do C,if (....
You can add up to 6 if , i think.

So in my previous reply replace "nothing" with:
....if(and(d47<0,c47>0),g47/d47,"newnothing" and close with the right
number of ).

Good luck with that backtesting
 
B

Bob Phillips

=IF(AND(C47<0,D47<0),ABS(G47/D47),IF(OR(C47<0,D47<0),G47/C47+1,G47/D47))


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top