View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rick Rothstein \(MVP - VB\)[_641_] Rick Rothstein \(MVP - VB\)[_641_] is offline
external usenet poster
 
Posts: 1
Default Dividing by zero

Perhaps this does what you want...

=IF(I19=0,IF(K19=0,0,-0.15),MAX(MIN(((I19-K19)/I19),0.15),-0.15))

Rick


"jvega" wrote in message
...
Ok, I put your formula in, but when I19 and K19 are both 0, it equals -.15
still. How would I make it equal 0?

Thanks

"Rick Rothstein (MVP - VB)" wrote:

Try this formula instead of the one you posted...

=IF(I19=0,-0.15,MAX(MIN(((I19-K19)/I19),0.15),-0.15))

Rick


"jvega" wrote in message
...
Hello,

I have this formula: I7=MAX(MIN(((I19-K19)/I19),0.15),-0.15), where I
want
the range to be from -0.15 to 0.15.

However, when I19=0, I obviously get the message that I can't divide by
zero.

So, how would I change I7 so that when I19=0, I7 will equal -.15,

BUT, when I19=0, AND K19=0, I7will equal 0.

Thanks for you help, it is much appreciated,

Regards,

JV