+ Reply to Thread
Results 1 to 10 of 10

10 day Rolling Average

  1. #1
    Registered User
    Join Date
    05-30-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Unhappy 10 day Rolling Average

    Hi guys,

    I have a table of data where the first row contains the date headers, and the first column represents lot numbers which are being sold.
    The amounts sold are displayed horizontally by day, so we can reconcile our sales.

    I would like to calculate the moving average of the last 10 days, and have it update that rolling average as we add in new data to the next day.

    I have tried various functions using INDEX and OFFSET, but can't seem to get it to work for me.

    The other versions of the dynamic moving average formulas are for a single data set, where the moving average is calculated on a separate row, rather than on the same row.

    My values to calculate the moving averages are in the array E2:LR2.

    I've tried this one:
    =AVERAGE(INDEX(E2:LR2,LARGE(COLUMN(E2:LR2)*(E2:LR2<>""),10)):LR2)
    but this does not seem to work.

    E2:LR2 represents the days or the year for us to record sales data.

    Any help would be greatly appreciated!!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    42,911

    Re: 10 day Rolling Average

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    5,859

    Re: 10 day Rolling Average

    Try:

    =AVERAGE(OFFSET(E2,0,COUNT(E2:LR2)-1,1,-MIN(10,COUNT(E2:LR2))))

  4. #4
    Registered User
    Join Date
    05-30-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Re: 10 day Rolling Average

    Posting sample.
    The yellow highlighted cells are the last 10 days of input values to calculate the moving average.
    As I post more information into the empty cells representing future dates, I want that 10 day to slide forward to include only the 10 most recent values averaged.

    Thanks for your help!
    Attached Files Attached Files

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2010
    Posts
    5,859

    Re: 10 day Rolling Average

    Try array formula:

    =AVERAGE(IF(COLUMN(E2:LR2)*(E2:LR2<>"")>=LARGE(COLUMN(E2:LR2)*(E2:LR2<>""),MIN(10,COUNT(E2:LR2))),E2:LR2))

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    42,911

    Re: 10 day Rolling Average

    Try ... C2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-30-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Re: 10 day Rolling Average

    This one works perfectly, and also helps with 0 values, which the previous post did not.

    Thanks for your help!!

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    42,911

    Re: 10 day Rolling Average

    This one works perfectly, and also helps with 0 values, which the previous post did not.
    Which formula works perfectly?

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: 10 day Rolling Average

    maybe try to use:

    @TMS
    and your text

    or/and

    @Phuocam
    and your text

    will be easier for you and for us

  10. #10
    Registered User
    Join Date
    05-30-2018
    Location
    Canada
    MS-Off Ver
    2016
    Posts
    4

    Re: 10 day Rolling Average

    It was the array formula:
    '=AVERAGE(IF(COLUMN(E2:LR2)*(E2:LR2<>"")>=LARGE(COLUMN(E2:LR2)*(E2:LR2<>""),MIN(10,COUNT(E2:LR2))),E2:LR2))

    Posted by Phuocam

    Thank you.

+ 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. Rolling Average
    By cory0789 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-20-2017, 03:56 PM
  2. [SOLVED] Rolling Average
    By T15K in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-14-2013, 06:38 PM
  3. [SOLVED] 5 Day rolling average
    By spazzcdnm in forum Excel General
    Replies: 3
    Last Post: 07-17-2012, 04:27 PM
  4. Rolling average
    By gth8991 in forum Excel General
    Replies: 3
    Last Post: 10-03-2011, 11:57 AM
  5. Rolling Average
    By Skee in forum Excel General
    Replies: 9
    Last Post: 04-19-2009, 02:39 PM
  6. rolling average
    By William Okumu in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-25-2006, 10:49 AM
  7. [SOLVED] Rolling 3 mth Average
    By dallin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-22-2005, 12:15 PM

Tags for this Thread

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