+ Reply to Thread
Results 1 to 19 of 19

Hide #div/0 error

Hybrid View

  1. #1
    Registered User
    Join Date
    09-07-2007
    Posts
    32

    Hide #div/0 error

    Anyone know how to get excel to display 0 instead of this? It pops up everywhere through my spreadsheet but cant get it to display 0.

    Regards

    Tom

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(ISERROR(A1/B1),0,A1/B1) or CF

    http://www.contextures.com/xlCondFormat03.html#Errors

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    09-07-2007
    Posts
    32
    Still no joy.

    I have attached the file.

    The Summery worksheet is displaying information from the Details worksheet.

    So if you look in Details and scroll down to the green column titled Kunal Benpuri, under Bahadur, Shekhar you can see there is no values available in his tables so Cell D107 displays #DIV/0! but i'd like it to display 0 as it makes the Summery worksheet look messy.

    Any ideas would be great.

    Thanks Again

    Kindest Regards

    Tom
    Attached Files Attached Files

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Maybe

    =IF(ISERROR(SUMPRODUCT(--(C93:C106)*(D93:D106))/C107),0,SUMPRODUCT(--(C93:C106)*(D93:D106))/C107)

    or use the Conditional Format idea on the link I provided

    VBA Noob

  5. #5
    Registered User
    Join Date
    09-07-2007
    Posts
    32
    Hi thanks that works a treat.

    I know this is asking alot but would you be able to explain that formula for me. Just so i can understand whats going on where. I love to accept help but i like to understand how things work also just so it helps for future development.

    Cheers

    Tom

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    To avoid #DIV/0! errors you only really need to test whether the Denominator is zero, therefore you can use this formula

    =IF(C107,SUMPRODUCT(C93:C106,D93:D106)/C107,0)

  7. #7
    Valued Forum Contributor
    Join Date
    09-23-2005
    Location
    Bristol, UK
    MS-Off Ver
    2007
    Posts
    664
    See attached. Seems to work fine.

    SamuelT
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-07-2007
    Posts
    32
    Quote Originally Posted by SamuelT
    See attached. Seems to work fine.

    SamuelT
    Thank You Sir

  9. #9
    Forum Contributor corinereyes's Avatar
    Join Date
    12-02-2003
    Location
    Philippines
    MS-Off Ver
    MS Excel 2016
    Posts
    520
    Hi tompich,

    Try this also:

    On cell D107:

    ={IF(C93:C106 = 0, 0, SUM(C93:C106*D93:D106)/C107)}
    Corine

  10. #10
    Registered User
    Join Date
    09-07-2007
    Posts
    32
    Hi the only problem with this is that it only works if the table is empty. If i populate the table with figures the figure remains 0. Is there an alternative formula that allows it to work both ways?

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699
    Hello tompich, which suggestion are you referring to? My suggestion above will give the correct results when numbers are added, I believe, and it doesn't require CTRL+SHIFT+ENTER

    =IF(C107,SUMPRODUCT(C93:C106,D93:D106)/C107,0)

  12. #12
    Valued Forum Contributor
    Join Date
    09-23-2005
    Location
    Bristol, UK
    MS-Off Ver
    2007
    Posts
    664
    Hi,

    Try this:

    =IF(ISERROR(your formula),0,your formula)

    HTH,

    SamuelT

+ 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