+ Reply to Thread
Results 1 to 5 of 5

Average every Nth cell in a row not including 0

  1. #1
    Registered User
    Join Date
    10-25-2010
    Location
    Michigan
    MS-Off Ver
    Excel Mac 2008 version 12.2.6
    Posts
    10

    Average every Nth cell in a row not including 0

    I am new to this forum, so I hope I'm putting this in the right place, but I have a very large spreadsheet and need help averaging every third cell that is not 0. I have searched forever and have hand no luck with the solutions I've found. The data is horizontal in rows (i.e. A1:L1) not columnar.

    Any suggestions as to how I can make that work?
    Last edited by RJunior; 10-25-2010 at 06:48 PM. Reason: clarification of data direction

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

    Re: Average every Nth cell in a row not including 0

    If you have a "header row" with the same text in every row, e.g. header row has "apples" in A1, D1, G1, J1 etc. then the easiest way is to use AVERAGEIFS function, e.g.

    =AVERAGEIFS(A2:Z2,A$1:Z$1,"apples",A2:Z2,"<>0")

    otherwise this "array" formula will average every third cell starting with the 1st in the range (in this case A2) but excluding non-zero values.

    =AVERAGE(IF(MOD(COLUMN(A2:Z2)-COLUMN(A2),3)=0,IF(A2:Z2<>0,A2:Z2)))

    confirmed with CTRL+SHIFT+ENTER
    Audere est facere

  3. #3
    Registered User
    Join Date
    10-25-2010
    Location
    Michigan
    MS-Off Ver
    Excel Mac 2008 version 12.2.6
    Posts
    10

    Re: Average every Nth cell in a row not including 0

    Hi and thanks for the quick reply!

    I have tried the latter solution to no avail. The average is still taken of the total array (even after ctrl+shift+enter).

    the first solution may work, and I can't believe I didn't think to tie it to a header. I will try that and see what I can come up with.

    Thank you!
    Last edited by Paul; 10-25-2010 at 07:34 PM. Reason: Removed quote of full post.

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

    Re: Average every Nth cell in a row not including 0

    Quote Originally Posted by RJunior View Post
    The average is still taken of the total array (even after ctrl+shift+enter).
    Can you post the formula you tried, it certainly works for me when I test it.....

  5. #5
    Registered User
    Join Date
    10-25-2010
    Location
    Michigan
    MS-Off Ver
    Excel Mac 2008 version 12.2.6
    Posts
    10

    Re: Average every Nth cell in a row not including 0

    Quote Originally Posted by daddylonglegs View Post
    Can you post the formula you tried, it certainly works for me when I test it.....
    the formula I'm using is:

    =AVERAGE(IF(MOD(COLUMN(C98:DU98)-COLUMN(C98),3)=0,IF(C98:DU98<>0,C98:DU98)))

+ 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