+ Reply to Thread
Results 1 to 4 of 4

Varying =AVERAGE length

  1. #1
    Registered User
    Join Date
    01-19-2013
    Location
    Carolinas
    MS-Off Ver
    Excel 2007
    Posts
    2

    Varying =AVERAGE length

    Hey Folk!
    This is probably simple but I'm stumped. I am creating a rolling average for a column of numbers but I want to be able to quickly lengthen or shorten the roll. For example E26 might read: =AVERAGE(D20:D26) but I might want to quickly swap that to a 14 day roll: E26 = AVERAGE(D13:D26). And I'm going to have a number of columns (maybe 10) that I want to quickly tweak.

    Maybe my question is, how can I make an equation like this work: E26 = AVERAGE(D26-x:D26) where x is the value in D1 (in this case, 7-1).

    Thanks!
    Last edited by Rbrt; 09-15-2014 at 08:14 AM. Reason: Success!

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Varying =AVERAGE length

    =AVERAGE(INDEX(D:D, 27-D1):D26)

    D1 contains the number of cells to average.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-19-2013
    Location
    Carolinas
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Varying =AVERAGE length

    Cool, except I would need to vary the 27 also. I have a column of numbers and a column of rolling averages, see attached.

    You would think I could figure it out from here. Something like this: =AVERAGE(INDEX(D:D,INDEX(A:A,A25)-D$1):D25)

    Appreciate the help! Index is a cool function.

    This statement hopefully is no longer valid - OK, the equations in this spd sht are slightly more complex than in the text above - Sorry!, but I can't seem to delete it and I know you can handle the extra stuff.
    Attached Files Attached Files
    Last edited by Rbrt; 09-14-2014 at 07:49 AM. Reason: updated attachment

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Varying =AVERAGE length

    In E19 and copy right and down,

    =AVERAGE($D18:INDEX($D:$D, ROW() - E$3))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Stack varying length columns
    By par0016 in forum Excel General
    Replies: 2
    Last Post: 01-21-2013, 06:51 PM
  2. Taking Average for Multiple Columns of Varying Length
    By NALynch in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2012, 04:12 PM
  3. [SOLVED] Varying length endpoints vba
    By amotto11 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-26-2012, 04:23 PM
  4. Sum varying length blocks of data
    By meetvivek72 in forum Excel General
    Replies: 3
    Last Post: 08-25-2011, 08:47 AM
  5. Sum varying length blocks of data
    By meetvivek72 in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 06-30-2011, 10:01 AM

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