+ Reply to Thread
Results 1 to 8 of 8

AVG Ignore Zero - Non adjacent cells

Hybrid View

  1. #1
    Registered User
    Join Date
    09-28-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    38

    AVG Ignore Zero - Non adjacent cells

    Hello,
    So, I need to do an average of cells:
    WeeklySummary!BZ32:BZ36,WeeklySummary!DD32:DD36

    but not include zeros in the average -

    I tried
    =AVERAGE(IF(WeeklySummary!BZ32:BZ36,WeeklySummary!DD32:DD36>0,WeeklySummary!BZ32:BZ36,WeeklySummary!DD32:DD36)) hitting ctrl shift enter and I get a msg saying I've entered too many arguments.

    Meanwhile, in another cell, I am able to use:
    =AVERAGE(IF(WeeklySummary!EH32:EH36>0,WeeklySummary!EH32:EH36)) hitting cntrl shift enter just fine - just can't seem to do it with multiple cell ranges.

    And for the record, this is an average of an average, but the person who needs the data would rather have it that way since the amount percentage of total waste, which is total feet, minus actual feet divided by total feet. I'm open to setting it up to have the actual average, but there again, it would be adding a subtracting a large number of cells and ignoring blank or zero cells.

    Thank you.
    Last edited by sabrinigreen; 11-02-2011 at 01:35 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: AVG Ignore Zero - Non adjacent cells

    Try:

    =SUM(SUMIF(INDIRECT({"WeeklySummary!BZ32:BZ36","WeeklySummary!DD32:DD3"}),">0"))/SUM(COUNTIF(INDIRECT({"WeeklySummary!BZ32:BZ36","WeeklySummary!DD32:DD3"}),">0"))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-28-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: AVG Ignore Zero - Non adjacent cells

    Quote Originally Posted by NBVC View Post
    Try:

    =SUM(SUMIF(INDIRECT({"WeeklySummary!BZ32:BZ36","WeeklySummary!DD32:DD3"}),">0"))/SUM(COUNTIF(INDIRECT({"WeeklySummary!BZ32:BZ36","WeeklySummary!DD32:DD3"}),">0"))
    This worked! thanks (I had to change the second DD cell reference to DD36, but yeah, it worked ;-)

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: AVG Ignore Zero - Non adjacent cells

    Quote Originally Posted by sabrinigreen View Post
    This worked! thanks (I had to change the second DD cell reference to DD36, but yeah, it worked ;-)
    ooops.. i copied the reference without the final 6..

  5. #5
    Registered User
    Join Date
    09-28-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: AVG Ignore Zero - Non adjacent cells

    Quote Originally Posted by NBVC View Post
    ooops.. i copied the reference without the final 6..
    I totally appreciate your help ;-)

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,179

    Re: AVG Ignore Zero - Non adjacent cells

    I'd suggest you do two x SUMIF and two x COUNTIF greater than zero. Add the two SUMIFs and add the two COUNTIFs and divide the latter into the former.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  7. #7
    Registered User
    Join Date
    09-28-2011
    Location
    Chicago, Illinois
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: AVG Ignore Zero - Non adjacent cells

    Quote Originally Posted by TMShucks View Post
    I'd suggest you do two x SUMIF and two x COUNTIF greater than zero. Add the two SUMIFs and add the two COUNTIFs and divide the latter into the former.

    Regards
    I kind of understand what you mean, but I am lost as to how to execute it.
    Do you mean finding out the real value versus the average of the average?

    Like adding all the total feet and adding all the actual feet, subtracting it and then dividing it by total feet? (that's how it is set up to determine each day's waste)

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,179

    Re: AVG Ignore Zero - Non adjacent cells

    I guess I was just being a bit lazy. What I meant was, do two SUMIFs and add them together and two COUNTIFs and add them together, and then divide the total SUMIFs by the total COUNTIFs.

    =(SUMIF(WeeklySummary!BZ32:BZ36,">0")+SUMIF(WeeklySummary!DD32:DD36,">0")) / (COUNTIF(WeeklySummary!BZ32:BZ36,">0")+COUNTIF(WeeklySummary!DD32:DD36,">0"))

    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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