+ Reply to Thread
Results 1 to 13 of 13

rolling averages

  1. #1
    Registered User
    Join Date
    06-05-2007
    Posts
    6

    rolling averages

    I am working on a spread sheet and am trying to use rolling averages of the last 3 months. I am using worksheets for each month with a final worksheet containing the 3 mo. rolling average. I tried using a formula with OFFSET and it worked fine if all the data was in 1 worksheet, but did not work for multiple worksheets averaging to another worksheet in the same workbook.

  2. #2
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    Please post a sample of your file, maybe there's a possibility with VLOOKUP.
    Just keep it simple !


    http://www.excelguide.eu
    In English as well as in Dutch

  3. #3
    Registered User
    Join Date
    06-05-2007
    Posts
    6

    rolling averages example

    attached is a version of the spreadsheet I am working on for a rolling average.

  4. #4
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517

    More Information Required.

    If it is difficult to construct and attach an example workbook,
    at least give us a precise example of one of your OFFSET() formulas.

    From your original post it is impossible to work out what is wrong.

  5. #5
    Registered User
    Join Date
    06-05-2007
    Posts
    6

    example

    =AVERAGE(OFFSET('RIC - May'!D5,COUNT('RIC - May'!D5,'RIC - June'!D5,'RIC - July'!D5,'RIC - Aug'!D5,'RIC - Sep'!D5,'RIC - Oct'!D5,'RIC - Nov'!D5,'RIC - Dec'!D5)-3,0,3,1))

    This is the formula I am using, honestly I am not sure about the final piece
    "-3,0,3,1"

  6. #6
    Registered User
    Join Date
    06-05-2007
    Posts
    6

    Example of the rolling average problem

    Attached is a zip file of the rolling averages problem. Any help would be appreciated!
    Attached Files Attached Files

  7. #7
    Forum Contributor WinteE's Avatar
    Join Date
    04-07-2007
    Location
    Netherlands
    Posts
    544
    For as far as I can see you have two possibilities :

    1. Use VLOOKUP and change the formulas each month;

    2. Fix it using VBA.

    Option 1 is a qiuck solution, option 2 something for a specialist.

  8. #8
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517
    [QUOTE=bradleyhanks]
    =AVERAGE(OFFSET('RIC - May'!D5,COUNT('RIC - May'!D5,'RIC - June'!D5,'RIC - July'!D5,'RIC - Aug'!D5,'RIC - Sep'!D5,'RIC - Oct'!D5,'RIC - Nov'!D5,'RIC - Dec'!D5)-3,0,3,1))
    QUOTE]

    The COUNT() will give you the number of of sheets that have entries in D5.
    So you are taking the average of 3 cells from column D of the sheet called 'RIC - May',
    These three cells are offset relative to the cell 'RIC - May'!D5 by several cells.
    This offset is equal to the number of of sheets that have entries in D5 minus 3.
    I suspect this is not what you were intending...
    Unfortunatly I can't open attachments from this forum, but if you can describe what you were intending, I might be able to help.

  9. #9
    Registered User
    Join Date
    06-05-2007
    Posts
    6

    rolling averages

    My workbook has a sheet for each month (May - Dec) plus a rolling average sheet. I am trying to take a rolling average of the last three months. The data is in cell D5 in each sheet.

    Worksheet Cell w/data
    May D5
    June D5
    July D5
    Aug D5
    Sep D5
    Oct D5
    Nov D5
    Dec D5

    Avg D5 (I want a rolling average in this cell in this particular
    worksheet pulling the data from the other worksheets)

    The formula I gave in a previous posting is probably incorrect, b/c I think it is set to pull the rolling average from only one worksheet and not multiple sheets.
    Last edited by bradleyhanks; 06-06-2007 at 10:51 AM.

  10. #10
    Registered User
    Join Date
    06-05-2007
    Posts
    6

    another question

    Ok, assuming I cannot do a rolling average amongst worksheets in a workbook like I would prefer, I do have another possible solution, but I am running into problems with it as well. I have added an "IF" statement to a cell that says
    =IF(W1="May",AVERAGE('RIC - Mar'!$D$6,'RIC - Apr'!D6,'RIC - May'!D6),IF(W1="June",AVERAGE('RIC - Apr'!D6,'RIC - May'!D6,'RIC - June'!D6),IF(W1="July",AVERAGE('RIC - May'!D6,'RIC - June'!D6,'RIC - July'!D6),IF(W1="August",AVERAGE('RIC - June'!D6,'RIC - July'!D6,'RIC - Aug'!D6),IF(W1="September",AVERAGE('RIC - July'!D6,'RIC - Aug'!D6,'RIC - Sep'!D6)))))). This gives me a three month average, but to do a whole year I must use multiple cells. I then want the following experession to check each of the cells for data and if it has data and not a FALSE, to rank it. The forumula is: =IF(D5>=0.951,5,IF(D5>=0.901,4,IF(D5>=0.851,3,IF(D5>=0.801,2,IF(D5<0.801,0))))). How do I tell the cell to look at cell E5 if cell D5 delivers a FALSE, and to then rank it with the previous formula?

  11. #11
    Forum Contributor
    Join Date
    10-27-2006
    Location
    United Kingdom
    MS-Off Ver
    EXCEL 2003 (2007 at home)
    Posts
    517

    I wouldn't start from here

    I think you are trying to use the OFFSET() function inappropriately.
    As I see your problem the AVERAGE() needs three addresses that change according to the month.
    I would probably approach this problem as follows:
    Set up a list of the worksheet names along a row (or down a column)
    select the first worksheet name and add on the rest of the text to make an address
    either =A1&"!D5" or use the ADDRESS() function
    repeat for the other two addresses, then:
    =AVERAGE(INDIRECT(address1),INDIRECT(address2),INDIRECT(address3))
    The key function is the INDIRECT() which will return the value from within a cell where the address is given in a text string.

    I hope this helps.

  12. #12
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269

    Smile

    I attach the sample workbook below. It will give you the last 3 months average.


    Hope it helps!
    Last edited by vane0326; 06-06-2007 at 11:31 PM.

  13. #13
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Oops I forgot to attach the workbook.
    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