+ Reply to Thread
Results 1 to 16 of 16

Average of everyother cell (excluding zeros)

  1. #1
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Average of everyother cell (excluding zeros)

    Hi all,

    I current have an Excel doc that I am trying to pull averages from. Every row has data that needs to be averaged but I only need everyother cell. And I cannot have zeros in the average because it will skew the data. Also if the average for a row ends up being 0, I want that average to show up as 0 not #DIV/0!. From Column H to EE I need to average each row individually.
    I came up with the below forumula.

    =IF(SUM(H1:H1:J1:J1:L1:L1)=0, "0", AVERAGEIF(H1:H1:J1:J1:L1:L1, ">0")

    It works but Its not practical because I have to manually enter all of the cells that it pulls from. If anyone could offer any advice or help, it would be much appreciated.

    Thanks in advance!

  2. #2
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Average of everyother cell (excluding zeros)

    Hi aaverett3

    The AVERAGEIF is not available in Excel 2003
    Regards Kevin


    Merged Cells (They are the work of the devil!!!)

  3. #3
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Average of everyother cell (excluding zeros)

    Sorry! I didn't update that correctly. I have Excel 2010 I believe

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Average of everyother cell (excluding zeros)

    aaverett3,

    Welcome to the forum!
    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Average of everyother cell (excluding zeros)

    I just tried this and it does not address the issue of using every other cell. I also realized that my formula fails to do so as well

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Average of everyother cell (excluding zeros)

    Updated formula:
    Please Login or Register  to view this content.

  7. #7
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Average of everyother cell (excluding zeros)

    With error checking (backwards compatible):
    Please Login or Register  to view this content.

    Excel 2007+:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Average of everyother cell (excluding zeros)

    That works except it still counts the zeros in the averages.

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Average of everyother cell (excluding zeros)

    This array formula will average every other cell from H1, excluding zeroes

    =AVERAGE(IF(MOD(COLUMN(H1:EE1)-COLUMN(H1),2)=0,IF(H1:EE1<>0,H1:EE1)))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  10. #10
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Average of everyother cell (excluding zeros)

    It came back with a #Value! Error. I am trying to work through it but I can't figure out why exactly

  11. #11
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Average of everyother cell (excluding zeros)

    You need to confirm with CTRL+SHIFT+ENTER

    Paste the formula in a cell, press F2 key to select formula then hold down CTRL and SHIFT keys while pressing ENTER - if done correctly you'll get curly braces like { and } around the formula in the formula bar.....and a numeric result

  12. #12
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Average of everyother cell (excluding zeros)

    Is there anyway to permanently confirm the formula? Becuase my coworkers will probably be in this document at some point and I don't want to have to confirm the formula everytime they double clicck on the "average" cell

  13. #13
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Average of everyother cell (excluding zeros)

    And if not is there another approach I could take?

  14. #14
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Average of everyother cell (excluding zeros)

    If you don't want to use an array formula you can go back to tigeravatar's approach - this version doesn't need CSE but should give you the same result

    =SUMPRODUCT(--(MOD(COLUMN(H1:EE1)-COLUMN(H1),2)=0),H1:EE1)/MAX(1,SUMPRODUCT(--(MOD(COLUMN(H1:EE1)-COLUMN(H1),2)=0),--(H1:EE1>0)))

  15. #15
    Registered User
    Join Date
    05-09-2013
    Location
    Georgia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Average of everyother cell (excluding zeros)

    Thank you all so much!! This just saved the day for me!

  16. #16
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Average of everyother cell (excluding zeros)

    If you can have some sort of "identifier" to show which columns to average, e.g. an "x" in row 1 indicating which columns to average in row 2 then it can be a lot easier because you can use AVERAGEIFS like this

    =IFERROR(AVERAGEIFS(H2:EE2,H$1:EE$1,"x",H2:EE2,">0"),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