+ Reply to Thread
Results 1 to 4 of 4

Rolling Average:use INDEX and OFFSET

  1. #1
    Registered User
    Join Date
    03-25-2005
    Posts
    9

    Rolling Average:use INDEX and OFFSET

    Oh, I thought I was pretty good with Excel, but I just cannot figure this out... I simply want to average the last 10 values in a column. Every time a new row is added, I don't want to have to update the formula. I figure I have to use INDEX and OFFSET but can't make it work.

    For the purpose of this question, you can assume the numbers are in column A starting at row 2. A follow up question might be, "what if there aren't 10 rows of data" but I won't go there at this point.

    Please teach me.

    Much thanks.

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

    Please Login or Register  to view this content.
    Note: This takes into account when there are less than 10 values to average.
    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
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211
    Quote Originally Posted by SKAh
    Oh, I thought I was pretty good with Excel, but I just cannot figure this out... I simply want to average the last 10 values in a column. Every time a new row is added, I don't want to have to update the formula. I figure I have to use INDEX and OFFSET but can't make it work.

    For the purpose of this question, you can assume the numbers are in column A starting at row 2. A follow up question might be, "what if there aren't 10 rows of data" but I won't go there at this point.

    Please teach me.

    Much thanks.
    Assuming your data start in A2 and no blanks in between

    =AVERAGE(OFFSET(INDIRECT("A"&COUNT(A:A)+1),,,-MIN(COUNT(A:A),10),1))

  4. #4
    Registered User
    Join Date
    03-25-2005
    Posts
    9

    Awesome!

    Thanks to both of you. They work perfectly.

+ 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