#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default Divide by zero error

Whenever I use the below formula, I get a divide by zero error if one of the
numbers it uses is zero. Can someone tell me how to adjust the below formula
to make it display zero instead of the divide by zero error?

=((C13/C10)-E13)/((SQRT(E13*((1-E13)/C10)))*(SQRT(1-F10)))

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Divide by zero error


Really, that's probably the wrong way to approach the problem. A better
way would be to use data validation on the cells your formula references
so that user's can't enter zeros.

But if you want what you say you want, the simplest way to do it is
something like this:

=IF(ISERROR(((C13/C10)-E13)/((SQRT(E13*((1-E13)/C10)))*(SQRT(1-F10)))),0,((C13/C10)-E13)/((SQRT(E13*((1-E13)/C10)))*(SQRT(1-F10))))

Basically, that says If your original formula returns an error, return
a zero. If not, return the calculated value. I'm suggesting the
ISERROR function because (as you may have noticed) a value greater than
1 for F10 also causes your formula to generate an error.

You could simplify the above a bit by using just the denominator of
your calculation (the (SQRT(E13*((1-E13)/C10)))*(SQRT(1-F10)) piece )
because you can't get a divide by zero unless that piece evaluates to
zero. But if you just check to see if that is zero, you miss the
'protection' of detecting the issue of the F10 value I mentioned above.

Hope this helps...


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=113585

  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Divide by zero error

You could try something like this:
=IF(OR(C10={"",0}),0,yourformula)
which checks the denominator part of your formula
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---
"Jacq" wrote:
Whenever I use the below formula, I get a divide by zero error if one of the
numbers it uses is zero. Can someone tell me how to adjust the below formula
to make it display zero instead of the divide by zero error?

=((C13/C10)-E13)/((SQRT(E13*((1-E13)/C10)))*(SQRT(1-F10)))

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Divide by zero error

Just adapt/extend it if necessary, to trap all the cells:
=IF(OR(C10={"",0},E13={"",0}),0,yourformula)
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
---

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Divide by zero error

Try

=IF(C10+0=0,0,((C13/C10)-E13)/((SQRT(E13*((1-E13)/C10)))*(SQRT(1-F10))))

If this post helps click Yes
---------------
Jacob Skaria


"Jacq" wrote:

Whenever I use the below formula, I get a divide by zero error if one of the
numbers it uses is zero. Can someone tell me how to adjust the below formula
to make it display zero instead of the divide by zero error?

=((C13/C10)-E13)/((SQRT(E13*((1-E13)/C10)))*(SQRT(1-F10)))

Thanks

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
Divide by zero error Chris Excel Worksheet Functions 3 January 13th 09 03:14 PM
Divide by Zero Error hkslater Excel Worksheet Functions 7 June 12th 08 02:59 AM
divide by 0 error jmp JohnnyJomp New Users to Excel 2 February 29th 08 05:32 PM
Divide by zero error jimmy Excel Discussion (Misc queries) 1 June 13th 07 02:36 AM
Divide by zero error gregmosu Excel Discussion (Misc queries) 1 June 30th 06 05:00 PM


All times are GMT +1. The time now is 05:46 PM.

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"