+ Reply to Thread
Results 1 to 4 of 4

Using averageif when all cells are 0's

  1. #1
    Registered User
    Join Date
    03-23-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Using averageif when all cells are 0's

    Hi,

    This issue is probably best shown with an example. If a range of ,say, 4 cells show 1, 2, 3, and 0, I want the formulated cell to show the average excluding the 0, which I use the averageif function for and it works great (this is the formula I use: =averageif(T12:T15,"<>0"); which equals 2 in this case.

    My problem is that occasionally all 4 of these cells will be 0 which results in the formulated cell showing #DIV/!. What I need is for this formulated cell show a 0 in this situation but still apply the above formula when this isn't the situation. The reason for this is the number that this formulated cell produces is part of another formula, so for obvious reasons I can't have #DIV/! showing.

    I've attempted to play around with combining averageif, OR and IF functions but I haven't been able to figure it out. I've attached an example to help explain.

    Any help will be greatly appreciated (and hope all this makes sense!)

    Thanks.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Using averageif when all cells are 0's

    Chris, welcome to the forum.

    You just need to wrap an "ISERROR" around your formula, which you can tell to return 0 if the formula evaluates to an error or div/0.

    Please see attached, which I hope helps.
    Attached Files Attached Files
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Registered User
    Join Date
    03-23-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Using averageif when all cells are 0's

    Perfect! Thank you so much, this has been a really big help.

  4. #4
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Using averageif when all cells are 0's

    No problem - glad to help. Can you please mark this thread as "SOLVED" using the thread tools, provided you're satisfied that it is?

    Thank you.

+ 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