+ Reply to Thread
Results 1 to 5 of 5

#DIV/0! Display

  1. #1
    Registered User
    Join Date
    11-27-2006
    Posts
    47

    #DIV/0! Display

    I have several cells that calculate the percentages of certain situations. Some of the situations have not yet occured and therefore result in a division by zero. Is it possible to have the cell display "0%" (or some other specified term) instead of "#DIV/0!" ?

    Thanks - Scott

  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
    Hi,

    Try a simple if statement

    e.g

    =IF(ISERROR(B1/C1),0,B1/C1)

    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
    11-27-2006
    Posts
    47
    =M37/(M37+M38)

    Currently, M37=0 and M38=0, and as a result, the formula results in #DIV/0!

    I attempted to use the formula that you suggested, but I may have made a mistake.

    =IF(ISERROR(M24/(M24+M25)),0,(M24/(M24/M25)))

    When I applied the same formula to cells that were not both 0, I either recieved 100% or the same error.

  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
    Hi,

    Should work (see attached)

    http://www.j-walk.com/ss/excel/usertips/tip010.htm

    VBA Noob

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,719
    You could use

    =IF(M37+M38,M37/(M37+M38),0)

+ 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