+ Reply to Thread
Results 1 to 8 of 8

Avoid #DIV/0! error

  1. #1
    Registered User
    Join Date
    01-11-2007
    Posts
    94

    Avoid #DIV/0! error

    Hi,

    I have following values.

    A1 -100
    B1 - either zero or blank
    C1 - Formula A1/B1

    When B1 is either zero or blank it gives me #DIV/0! value. Is there a way to avoid it.

    Thnx
    NKRA
    Last edited by NKRA; 07-28-2010 at 05:23 PM.

  2. #2
    Registered User
    Join Date
    06-30-2010
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    58

    Re: How to Avoid #DIV/0! error simple formula

    you could use

    Please Login or Register  to view this content.
    where it shows nothing if it finds an error. ( the ,"" part).

  3. #3
    Registered User
    Join Date
    06-30-2010
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    58

    Re: How to Avoid #DIV/0! error simple formula

    If you are using a pre 2007 version of excel you might need to code a module so you are able to use that function.

    alt+F11 or right click->view code to get into vba editor.

    On the upper menu go to Insert-> choose module from drop down list.

    copy and paste this

    Please Login or Register  to view this content.
    File->Close and return to Microsoft Excel

  4. #4
    Registered User
    Join Date
    01-11-2007
    Posts
    94

    Re: How to Avoid #DIV/0! error simple formula

    I believe you wanted to iserror, when i used the =iserror(A1/B1,"") formula is not being accepted.

    Any other resolution. I want to get C1 as zero if B1 is Blank or Zero.

  5. #5
    Registered User
    Join Date
    01-11-2007
    Posts
    94

    Re: How to Avoid #DIV/0! error simple formula

    Cannot use macro or codes.

  6. #6
    Registered User
    Join Date
    06-30-2010
    Location
    Tucson, Arizona
    MS-Off Ver
    Excel 2007
    Posts
    58

    Re: How to Avoid #DIV/0! error simple formula

    Please Login or Register  to view this content.
    returns 0 if B1=0 or B1 is blank. returns A1/B1 if any other value.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Avoid #DIV/0! error

    Or

    =IF(SUM(B1),A1/B1,0)

  8. #8
    Registered User
    Join Date
    01-11-2007
    Posts
    94

    Re: Avoid #DIV/0! error

    Worked like Charm, Thanks for help

    Marked it as Solved

+ 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