+ Reply to Thread
Results 1 to 11 of 11

Running average formula

  1. #1
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Running average formula

    Hi all,
    i have a situation. I need to calculate the running average for the last 3 weeks in the attached spread sheet. i want the formula to be such that i dont need to update each week as new data are filled in. we are in week 7 at the moment in the attached example. What formula would assist to achieve this?

    Regards,
    Shrijan
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Running average formula

    In N2

    =AVERAGE(INDEX(B2:L2,COUNT(B2:L2)):INDEX(B2:L2,COUNT(B2:L2)-2))

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: Running average formula

    Hi Ace,

    Thanks so much for your prompt response. One quick question, if the average required is for 10 weeks, should i simply change the -2 (in the end) to -10?
    S

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Running average formula

    Quote Originally Posted by shrijan View Post
    Thanks so much for your prompt response. One quick question, if the average required is for 10 weeks, should i simply change the -2 (in the end) to -10?
    The -2 shd be changed to -9

    If you have less than the requisite number of weeks, you'll run into an error. To circumvent that use
    =IFERROR(AVERAGE(INDEX(B2:L2,COUNT(B2:L2)):INDEX(B2:L2,COUNT(B2:L2)-2)),"")

  5. #5
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: Running average formula

    Thanks again. i meant, if there were 52 weeks, and i needed to calculate the running average of the last 10 weeks, and assuming we're in the 11th week, then how would the above formula change?
    S

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Running average formula

    =AVERAGE(INDEX(B2:L2,COUNT(B2:L2)):INDEX(B2:L2,COUNT(B2:L2)-9))

    The highlighted number should always be n-1 i.e.

    If you need average of 10 weeks, it should be 9
    If you need average of 8 weeks, it should be 7
    If you need average of 21 weeks, it should be 20

    etc

  7. #7
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 365
    Posts
    2,406

    Re: Running average formula

    =IF(COUNT(B2:L2);AVERAGE(L2:INDEX(B2:L2;LARGE(IF(ISNUMBER(B2:L2);COLUMN(B2:L2));MIN(3;COUNT(B2:L2)))-COLUMN(B2)+1));"")

    Array Formula
    Azumi

  8. #8
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: Running average formula

    hi Ace,
    Thanks for this. I am still getting incorrect answers. hence have attached a new spread sheet. what formula do i use in column BE if i need the running average of the last 10 weeks. we are in the 7-13 October week

    Shrijan
    Attached Files Attached Files

  9. #9
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Running average formula

    that's because you have zeroes in all the future weeks. get rid of the zeroes for future weeks and then use

    =AVERAGE(INDEX(C3:BC3,COUNT(C3:BC3)):INDEX(C3:BC3,COUNT(C3:BC3)-9))

  10. #10
    Registered User
    Join Date
    10-13-2013
    Location
    Sydney
    MS-Off Ver
    Excel 2013
    Posts
    52

    Re: Running average formula

    Thank you. seems to be working perfectly.
    Shrijan

  11. #11
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Running average formula

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Running Average formula
    By livemusic in forum Excel General
    Replies: 2
    Last Post: 03-23-2012, 06:29 AM
  2. Running average formula (in same cell)
    By wonderdunder in forum Excel General
    Replies: 8
    Last Post: 02-27-2011, 07:03 AM
  3. help with a running average formula
    By jacflash in forum Excel General
    Replies: 3
    Last Post: 06-24-2010, 06:34 AM
  4. Running average formula?
    By Jeebs in forum Excel General
    Replies: 2
    Last Post: 07-08-2008, 10:48 AM
  5. Running average formula
    By CYLax in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-20-2007, 09:36 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