+ Reply to Thread
Results 1 to 9 of 9

Average of Rolling Averages - Undefined data points

  1. #1
    Registered User
    Join Date
    05-26-2009
    Location
    Atlanta, Georgia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Average of Rolling Averages - Undefined data points

    Wondering if someone can help me figure this out.

    I have a row with numbers, like this:

    4 5 1 6 2 7 3 1 12 0 -

    I need to get the rolling average of the sum of 4 numbers, but stopping at the point in the row where the first 0 occurs. So in this example, the result would be:

    the average of the following sums: (4+5+1+6) & (5+1+6+2) & (1+6+2+7) & (6+2+7+3) & (2+7+3+1) & (7+3+1+12)

    Where the first 0 comes will be variable and thus I need a function that determines that.

    Any ideas? Thanks.
    Last edited by apierce; 05-26-2009 at 08:17 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: Average of Rolling Averages - Undefined data points

    I've did it with 2 extra lines... but someone will bring them to one so I'll post it here just in case

    Book1.xls

    Row 4 are data
    Row 3 is sum of first 4 numbers
    Row 2 find where is 0 and takes 4 (because of 4 numbers you summing).
    In this case 6-4=2... result will be sum of 2 groups

    And with sunmproduct or sumif you sumerise them (in yellow).

    Now... Someone put it in one line
    Never use Merged Cells in Excel

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

    Re: Average of Rolling Averages - Undefined data points

    I transposed your row to a column (which could be put back), and used a helper column (which could probably be eliminated).

    Please Login or Register  to view this content.
    Last edited by shg; 05-26-2009 at 03:50 PM. Reason: Formula bug!
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Average of Rolling Averages - Undefined data points

    Yeah, I don't even think I understood your two line approach.

    Anyway, two formulas, one to make sure we can even start the counts (no zero in the first 4 cells) and then the second formula that copies across and generates usable values.

    Then a normal Averaging at the end.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,040

    Re: Average of Rolling Averages - Undefined data points

    Oh, yes, didn't see it's average... But it's just SUM()/4, right?

    other things work just fine

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Average of Rolling Averages - Undefined data points

    No, it's an average of the resulting values, not an average of the subsets of 4 cells.

  7. #7
    Registered User
    Join Date
    05-26-2009
    Location
    Atlanta, Georgia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Average of Rolling Averages - Undefined data points

    Thanks for the responses....The latest solution yields a correct answer but my problem is that I have hundreds of rows with values that I need the average for, so creating hundreds more of columns would be undesirable. Any way to get the results all calculated in one cell next to the list of values?

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

    Re: Average of Rolling Averages - Undefined data points

    Post a workbook with some actual data.

  9. #9
    Registered User
    Join Date
    05-26-2009
    Location
    Atlanta, Georgia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Average of Rolling Averages - Undefined data points

    Heres the sample and desired info.
    Attached Files Attached Files

+ 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