+ Reply to Thread
Results 1 to 15 of 15

# DIV/0! error in Excel

  1. #1
    Helpwanted
    Guest

    # DIV/0! error in Excel

    I have a function that divides two numbers, sometimes those numbers are 0 so
    the result is # DIV/0!. My second function is based on the result of the
    first function. Since there isnt always data available for the first function
    I get the # DIV/0! error and my final calculation wont calculate. I need the
    final calculation to disregard any 0 cells or # DIV/0! errors and still
    calculate the data that is available.

  2. #2
    Guest

    Re: # DIV/0! error in Excel

    Hi
    You need to wrap your division with an IF() so it will evalluate the result
    before it puts anything in the cell. Try something like:
    =IF(A2>0,A3/A2,0)

    --
    Andy.


    "Helpwanted" <[email protected]> wrote in message
    news:[email protected]...
    >I have a function that divides two numbers, sometimes those numbers are 0
    >so
    > the result is # DIV/0!. My second function is based on the result of the
    > first function. Since there isnt always data available for the first
    > function
    > I get the # DIV/0! error and my final calculation wont calculate. I need
    > the
    > final calculation to disregard any 0 cells or # DIV/0! errors and still
    > calculate the data that is available.




  3. #3
    Bill Martin -- (Remove NOSPAM from address)
    Guest

    Re: # DIV/0! error in Excel

    Andy B wrote:
    > Hi
    > You need to wrap your division with an IF() so it will evalluate the result
    > before it puts anything in the cell. Try something like:
    > =IF(A2>0,A3/A2,0)
    >


    Or perhaps a more appropriate approximation fudge would be:

    =IF(A2>0,A3/A2,1E300)

    Bill

  4. #4
    Bill Martin -- (Remove NOSPAM from address)
    Guest

    Re: # DIV/0! error in Excel

    Andy B wrote:
    > Hi
    > You need to wrap your division with an IF() so it will evalluate the result
    > before it puts anything in the cell. Try something like:
    > =IF(A2>0,A3/A2,0)
    >



    Or perhaps a better approximation fudge would be:

    =IF(A2>0,A3/A2,If(A3>0,1e300,-1e300))

    Bill

  5. #5
    Guest

    Re: # DIV/0! error in Excel

    Hi Bill
    Why do you say that putting 1e300 would be a 'better approximation fudge'? I
    don't understand what that contributes towards the result!
    Cheers.
    --
    Andy.
    PS I can't believe I spelt evaluation with a double 'l'!!

    "Bill Martin -- (Remove NOSPAM from address)" <[email protected]>
    wrote in message news:%[email protected]...
    > Andy B wrote:
    >> Hi
    >> You need to wrap your division with an IF() so it will evalluate the
    >> result before it puts anything in the cell. Try something like:
    >> =IF(A2>0,A3/A2,0)
    >>

    >
    >
    > Or perhaps a better approximation fudge would be:
    >
    > =IF(A2>0,A3/A2,If(A3>0,1e300,-1e300))
    >
    > Bill




  6. #6
    Lewis Clark
    Guest

    Re: # DIV/0! error in Excel

    Because 1e300 is a very large number. When you divide by zero, you get an
    infinitely large number.

    Which one you use should depend on how you use this value in the next
    calculation.


    <Andy B> wrote in message news:uC5%[email protected]...
    > Hi Bill
    > Why do you say that putting 1e300 would be a 'better approximation fudge'?
    > I don't understand what that contributes towards the result!




  7. #7
    Bill Martin -- (Remove NOSPAM from address)
    Guest

    Re: # DIV/0! error in Excel

    Andy B wrote:
    > Hi Bill
    > Why do you say that putting 1e300 would be a 'better approximation fudge'? I
    > don't understand what that contributes towards the result!
    > Cheers.



    It's a matter of how to handle errors. For example, say you're trying
    to evaluate your return on investment. You invest $5 and get $10 back.
    Divide 10/5 = 2x return as desired.

    Now what would you get if for some reason the investment was $0? Your
    original example would say 0 return which is very plainly wrong and
    misleading. My version would return a huge number (1E200) which is also
    too small, but less so.

    This would allow downstream computations to continue, but would show up
    in the end as a huge stand out number which would flag that something
    peculiar was going on that should be investigated. Inserting "0" would
    hide the error rather than flagging it.

    The only thing worse than a spreadsheet which returns incorrect results
    might be one that also hides the fact that it's lied to you.

    IMHO....

    Bill

  8. #8
    LabElf
    Guest

    Re: # DIV/0! error in Excel

    I have to quibble. Strictly speaking, division by zero is meaningless - you
    can't divide anything into zero parts. You could, however, speak of the
    limit of (1/n) as n -> 0 as tending toward inifinity.
    --
    Assigning guilt doesn't solve the problem


    "Lewis Clark" wrote:

    > Because 1e300 is a very large number. When you divide by zero, you get an
    > infinitely large number.
    >
    > Which one you use should depend on how you use this value in the next
    > calculation.
    >
    >
    > <Andy B> wrote in message news:uC5%[email protected]...
    > > Hi Bill
    > > Why do you say that putting 1e300 would be a 'better approximation fudge'?
    > > I don't understand what that contributes towards the result!

    >
    >
    >


  9. #9
    Jay
    Guest

    Re: # DIV/0! error in Excel

    > I have a function that divides two numbers, sometimes those numbers
    > are 0 so the result is # DIV/0!. My second function is based on the
    > result of the first function. Since there isnt always data available
    > for the first function I get the # DIV/0! error and my final
    > calculation wont calculate. I need the final calculation to disregard
    > any 0 cells or # DIV/0! errors and still calculate the data that is
    > available.


    Here's one way.

    Suppose the first function is in A1.

    Then for the second function, you could put something like:
    =IF(ISERROR(A1),"N/A", <your second function here> )


  10. #10
    Registered User
    Join Date
    05-09-2005
    Posts
    3

    Exclamation Having the same # DIV/01 problem

    I read all I can in these forums about the # DIV/01 error, but I can't seem to figure out how to make it apply to what I am trying to do.

    This sheet I am doing is an on going project and there will be a number to divide against eventually, but for printing purposes, I want to hide the error. I am still trying to learn this program and all of this gets puzzling, Here is the formula I am working with =(G8-G9)/SUM(G8)

    Thanks for helping.

  11. #11
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    I am not sure why you use "SUM G8" in your formula =(G8-G9)/SUM(G8) as it is pointless to SUM one number.

    With that said, if you want to avoid the #DIV/0! error, first test the value of G8. If it is zero, return something else (blank or a text entry saying it is zero, etc.).

    Example:

    =IF(G8=0,"G8 is Zero",(G8-G9)/G8)

    should work for you.

    HTH

    Bruce
    Bruce
    The older I get, the better I used to be.
    USA

  12. #12
    Registered User
    Join Date
    05-09-2005
    Posts
    3
    It didn't work for me, maybe if I explain my format, it will help.

    I am using "SUM G8" because I have a formula in G10 that requires an answer =(G8*0.036).

    Currently in G8 there is nothing, but there will be at the end of the month, so when I punch G8 numbers and G9 numbers, G10 will be the answer. Where # DIV/0! is showing up is in G11, where the formula =(G8-G9)/SUM(G8) is and will give me my total %. out of a goal.

    My formula for G11 is correct, because when I have the numbers for the month, the correct percentage is there.

    It's possible I need to nest my formulas, but I am quite new at all of this and learning as I create this sheet, so nesting is another thing I need to learn.

    Thanks for helping.

  13. #13
    Forum Expert
    Join Date
    12-24-2004
    Location
    Sweden
    Posts
    1,256
    A simple solution to hide a errors from printing is Conditional Formatting.
    If an error occurs, change the text color to White --> will not show on a white paper.

    Ola Sandström

  14. #14
    Registered User
    Join Date
    05-09-2005
    Posts
    3

    Talking

    I couldn't make the conditions white. It's a project that will be updated every month and not by me, that's why I need to keep the formula but hide the fact that it's currently divided by 0. So when someone enters the final numbers for the month, it brings up the results of the calculation.


    Update:

    I figured out the solution to my problem.

    =IF(ISBLANK(F9),"",(F9-F10)/SUM(F9))

    Thank you to those who helped.
    Last edited by Reliance06; 05-10-2005 at 03:05 PM. Reason: Found My Solution

  15. #15
    Forum Expert swatsp0p's Avatar
    Join Date
    10-07-2004
    Location
    Kentucky, USA
    MS-Off Ver
    Excel 2010
    Posts
    1,545
    We are glad you solved your problem. It may be benficial to other visitors to this forum if you would post what your solution was. Many read these posts to get answers to similiar problems or simply to learn new ways of addressing issues. Your solution may help someone else.

    Thank you,

    Bruce

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1