+ Reply to Thread
Results 1 to 9 of 9

Display 0, Not #DIV=0!

  1. #1
    Registered User
    Join Date
    06-17-2012
    Location
    Greenwood, South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    2

    Display 0, Not #DIV=0!

    I am putting together baseball statistics for our local American Legion baseball team. I put in hits and at-bats, then used a simple formula to calculate batting average. The problem is that for some of the players there are no at-bats. The cell for batting average displays an error when it tries to divide by 0. How can I get the cell to display "0.000" instead of the error when a player has no at-bats? Thanks in advance for any help.

  2. #2
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Display 0, Not #DIV=0!

    Try:

    =IFERROR("your formula here",0)
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  3. #3
    Registered User
    Join Date
    06-17-2012
    Location
    Greenwood, South Carolina
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Display 0, Not #DIV=0!

    That worked perfect! Thanks so much!

  4. #4
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Display 0, Not #DIV=0!

    You're welcome. Don't forget to mark your thread as solved...

  5. #5
    Registered User
    Join Date
    02-12-2010
    Location
    Toms River, NJ
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Display 0, Not #DIV=0!

    Quote Originally Posted by Søren Larsen View Post
    Try:

    =IFERROR("your formula here",0)
    I didn't know about =IFERROR I've been using the kludge of doing the calculations into one cell, then I hide the column. Then using an =IF that detects if talus of the cell is > 0 if it's not it puts "" in the display otherwise it displaces the value of the cell

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Display 0, Not #DIV=0!

    @Manny iferror only works on 2007. not 2003, sorry
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Display 0, Not #DIV=0!

    Quote Originally Posted by MannyLNJ View Post
    I didn't know about =IFERROR I've been using the kludge of doing the calculations into one cell, then I hide the column. Then using an =IF that detects if talus of the cell is > 0 if it's not it puts "" in the display otherwise it displaces the value of the cell
    if you want to experiment, try ISERROR (available in 2003) in conjunction with Circular Referencing. if your data set is not large, performance would not be affected drastically and you would be able to use shorter formulae and get rid of some helper columns (if that is your intention).
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  8. #8
    Registered User
    Join Date
    02-12-2010
    Location
    Toms River, NJ
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Display 0, Not #DIV=0!

    Well I'm using Excel 2010 actually.

  9. #9
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Display 0, Not #DIV=0!

    Quote Originally Posted by MannyLNJ View Post
    Well I'm using Excel 2010 actually.
    well, it is very nice of you to fool us all by putting 2003 in your profile... i found it very funny, made my weekend.

+ 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