#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Dividing by zero

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
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Dividing by zero

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


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default Dividing by zero

I7=if(i19=0,-0,15,MAX(MIN(((I19-K19)/I19),0.15),-0.15))
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default Dividing by zero

sorry..

I7=if(and(i19=0,k19=0),0,if(i19=0,-0,15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Now correct.

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

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

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Dividing by zero

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





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Dividing by zero

Marcelo,

I couldn't get it to work, I copied and pasted your formula, and when I
pressed enter, it just stayed the same, as if it was just text, and yes I did
include the "=" without I7.

Thanks

"Marcelo" wrote:

sorry..

I7=if(and(i19=0,k19=0),0,if(i19=0,-0,15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Now correct.

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

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

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,047
Default Dividing by zero

I tested here and it works, take a look if the cell is formated as text.

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

Marcelo,

I couldn't get it to work, I copied and pasted your formula, and when I
pressed enter, it just stayed the same, as if it was just text, and yes I did
include the "=" without I7.

Thanks

"Marcelo" wrote:

sorry..

I7=if(and(i19=0,k19=0),0,if(i19=0,-0,15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Now correct.

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

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

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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




  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Dividing by zero

Hi,
Try:
=IF(AND(I19=0,K19=0),0,IF(I19=0,0.15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Regards - Dave.
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Dividing by zero

Marcelo,

It says "You've entered too many arguments for this function." I checked and
it's not formatted as text, what do you think it could be?

Thank you

"Marcelo" wrote:

I tested here and it works, take a look if the cell is formated as text.

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

Marcelo,

I couldn't get it to work, I copied and pasted your formula, and when I
pressed enter, it just stayed the same, as if it was just text, and yes I did
include the "=" without I7.

Thanks

"Marcelo" wrote:

sorry..

I7=if(and(i19=0,k19=0),0,if(i19=0,-0,15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Now correct.

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

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



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Dividing by zero

Sorry, that should be:
=IF(AND(I19=0,K19=0),0,IF(I19=0,-0.15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

"Dave" wrote:

Hi,
Try:
=IF(AND(I19=0,K19=0),0,IF(I19=0,0.15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Regards - Dave.

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Dividing by zero

Marcelo had a typo in his formula.
=if(and(i19=0,k19=0),0,if(i19=0,-0,15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))
should have been
=if(and(i19=0,k19=0),0,if(i19=0,-0.15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

An alternative way of expressing Marcelo's formula is
=IF(AND(I19=0,K19=0),0,IF(I19=0,-0.15,MEDIAN(-0.15,(I19-K19)/I19,0.15)))
Another alternative is
=IF(I19=0,IF(K19=0,0,-0.15),MEDIAN(-0.15,(I19-K19)/I19,0.15))
--
David Biddulph

"jvega" wrote in message
...
Marcelo,

It says "You've entered too many arguments for this function." I checked
and
it's not formatted as text, what do you think it could be?

Thank you

"Marcelo" wrote:

I tested here and it works, take a look if the cell is formated as text.

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

Marcelo,

I couldn't get it to work, I copied and pasted your formula, and when I
pressed enter, it just stayed the same, as if it was just text, and yes
I did
include the "=" without I7.

Thanks

"Marcelo" wrote:

sorry..

I7=if(and(i19=0,k19=0),0,if(i19=0,-0,15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Now correct.

--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"jvega" escreveu:

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



  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7
Default Dividing by zero

Dave,
Awesome, thanks for your help, it works now

Regards,
Josh

"Dave" wrote:

Sorry, that should be:
=IF(AND(I19=0,K19=0),0,IF(I19=0,-0.15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

"Dave" wrote:

Hi,
Try:
=IF(AND(I19=0,K19=0),0,IF(I19=0,0.15,MAX(MIN(((I19-K19)/I19),0.15),-0.15)))

Regards - Dave.

  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,388
Default Dividing by zero

Glad to help. Thanks for the feedback.
Dave.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dividing zero by zero Sanjeev Raghavan[_2_] Excel Worksheet Functions 4 March 1st 10 01:26 PM
Dividing by Zero TomRW Excel Discussion (Misc queries) 3 March 17th 08 08:57 PM
Dividing name kd Excel Worksheet Functions 1 April 19th 07 04:48 AM
Dividing by zero careyc Excel Discussion (Misc queries) 5 March 17th 06 11:03 PM
dividing a row LostNFound Excel Worksheet Functions 2 March 7th 05 05:49 PM


All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"