+ Reply to Thread
Results 1 to 3 of 3

Average + Offset?

  1. #1
    Forum Contributor
    Join Date
    04-14-2008
    Location
    Fort Collins, Co
    MS-Off Ver
    2016
    Posts
    107

    Red face Average + Offset?

    I have a sheet that has the months along the top and the values in rows. Every month, I need to calculate an average of the past two months. Every month I am also inserting a new month column so I always have to update my average. I think OFFSET can help but I'm not really understanding it.

    My Average cells are always 2 columns from the first value to average and 3 away from the other. The rows don't matter I don't think. I just drag the formula down to average each row independently.

    Any help appreciated. Extra info about how the function works in the formula you provide would be well loved!

    Thanks
    -Heather
    Last edited by 4am; 12-15-2010 at 02:46 PM.
    Is That Your Spreadsheet Or Did Your Database Just Throw Up?


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

    Re: Average + Offset?

    Try something like:

    =AVERAGE(OFFSET(F2,0,-2,1,2))

    where F2 is the cell you are actually putting the formula in, and assumes this formula is right after the last month's listing... so so far you would have numbers in A:E, then you can insert column between E and F, etc.

    Also can use non-volatile:

    =AVERAGE(INDEX(A2:F2,,COLUMN()-3):INDEX(A2:F2,,COLUMN()-2))

    in same F2 situation as above.
    Last edited by NBVC; 12-15-2010 at 02:33 PM.
    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
    Forum Contributor
    Join Date
    04-14-2008
    Location
    Fort Collins, Co
    MS-Off Ver
    2016
    Posts
    107

    Re: Average + Offset?

    Thanks. +Rep

+ 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