HELP!! NESTING FUNCTION

B

bullandbear1987

What do I do to this argument below 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


=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))
 
R

Ron Rosenfeld

What do I do to this argument below 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


=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))

You have some typos in what you posted, but I'm not sure exactly what you are
trying to do. If you view this in a fixed-width font, you should be able to
see where I pointed out the typos in the last IF clause.

=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))
^ ^

Perhaps if you described in words what you are trying to do, we might be able
to simplify.


--ron
 
S

SteveG

Add an additional IF statement.

=IF(AND(D47<0,C47>=0),G47/D47,"")

I'm not sure where you want it or what you want the result to be if th
conditions are not true so I just used "".

You can also use the SIGN function.

=IF(AND(SIGN(D47)=-1,SIGN(C47)=1),G47/D47,"")

HTH

Stev
 
G

Guest

Looking at your formula
=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))

according this formula:

if c47<0 AND d47<0 then
ABS(g47/d47)
else ' so c47>=0 OR d47>=0
if c47<0 then ' so d47 >=0
(g47/c47) + 1
else 'so c47 >= 0
g47/d47
endif
endif

and the rest of the formula is incorrect (there isn't more conditions for
last IF).

I think you need some changes in it:

if c47<0 AND d47<0 then
ABS(g47/d47)
else ' so c47>=0 OR d47>=0
if c47<0 then ' so d47 >=0
(g47/c47) + 1
else 'so c47 >= 0

'======== NEW
if d47<0 then 'this case is for c47>=0 AND d47<0
(g47/d47) ' according you write
else ' c47>= 0 AND d47 >=0
????? ' what you need
endif
endif
endif
In one formula:
=IF(AND(C47<0,D47<0),ABS(G47/D47),IF(C47<0,G47/C47+1,IF(D47<0,G47/D47,"???")))

Hope this helps (more or less).

Greetings,
 

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

Similar Threads


Top