+ Reply to Thread
Results 1 to 4 of 4

Average the last 10 cells of a dynamic column but ignore blank cells & 0

  1. #1
    Registered User
    Join Date
    03-06-2013
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    15

    Average the last 10 cells of a dynamic column but ignore blank cells & 0

    I have a spreadsheet that will dynamically be changing in the number of rows each column has. Each column may have random blanks or 0s within it. I want to average the last 10 cells in the column. If the columns last 10 rows have 5 values and 5 blanks, I'd like to simply average the 5 values and ignore the blanks. Please let me know if you need any clarification on what I am trying to do. Thanks in advance

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Average the last 10 cells of a dynamic column but ignore blank cells & 0

    Try this for column A

    =AVERAGE(INDEX(A:A,MATCH(9.99999999999999E+307,A:A,1)):INDEX(A:A,MATCH(9.99999999999999E+307,A:A,1)-9))

    Copy across
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    03-06-2013
    Location
    NYC
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Average the last 10 cells of a dynamic column but ignore blank cells & 0

    Thank you for this. Making progress, but having 1 issue. I've tried posting this earlier but doesn't seem to be posting so apologies if this is repetitive.

    I get a VALUE error in the columns where the last row of the table is blank. I am referencing a pivot table FYI.

    For example:

    100 200
    BLANK 300
    200 400
    300 BLANK

    The 2nd column would give me a VALUE error. Thanks!

  4. #4
    Forum Contributor
    Join Date
    12-23-2003
    Posts
    179

    Re: Average the last 10 cells of a dynamic column but ignore blank cells & 0

    Either...

    =AVERAGE(OFFSET(INDEX(A:A,MATCH(9.99999999999999E+307,A:A)),0,0,-10))

    Or...

    =AVERAGE(OFFSET(INDEX(A:A,MATCH(9.99999999999999E+307,A:A)),0,0,-MIN(10,COUNT(A:A)))

+ 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