+ Reply to Thread
Results 1 to 7 of 7

90 day average that changes?

  1. #1
    Registered User
    Join Date
    09-01-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    90 day average that changes?

    Hello all!

    I am trying to figure out how to figure a 90 day average from the last 3 values entered into a range.

    I have tried many examples but nothing so far has worked. So I am posting here pleading for your help!

    I want the average to change each time I enter new data. The columns are set up so that the first column (A) is the #, the second (B) is the person and columns C:L are months March - December. (Next year the months will be Jan - Dec of course)

    I want a 90 day average column at the end that will only average the last 3 percentages entered. BUT - I also want it to know if there are only 1 or 2 numbers entered, to either return some sort of text or average it for 1 or 2 times.

    For example:

    If Jul and Aug have data but Jun does not, since there is not 3 months to average, I want it to either average 2 months or just "N/A". I would prefer to average just the 2 months, but would be fine with anything other then #Nul

    I have attached the sheet I am working on, please help!
    Attached Files Attached Files

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

    Re: 90 day average that changes?

    Sorry, not working
    Last edited by zbor; 09-01-2009 at 07:35 AM.

  3. #3
    Forum Contributor
    Join Date
    08-11-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    149

    Re: 90 day average that changes?

    the xls worked for me.

    you could try: =AVERAGE(INDEX(C2:L2,1,MAX(IF(C2:L2<>"",COLUMN(C2:L2)))-COLUMN(C2)+1-2),INDEX(C2:L2,1,MAX(IF(C2:L2<>"",COLUMN(C2:L2)))-COLUMN(C2)+1-1),INDEX(C2:L2,1,MAX(IF(C2:L2<>"",COLUMN(C2:L2)))-COLUMN(C2)+1))

    It's an array formula, paste it into the cell and while in formula edit mode, hit shift-ctrl-enter.

    You have to use the menu commands for copy and paste special to copy the array formula down to other cells.

    I got the INDEX formula from exceltip.com and modified it from there.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: 90 day average that changes?

    You can get the Average without need for array if we assume that your data points are contiguous which the sample would imply, eg:

    Please Login or Register  to view this content.
    If you want to check for 0 numbers then add a COUNT test (via IF), eg:

    Please Login or Register  to view this content.
    You could also use OFFSET but that would be Volatile... hence my preference for INDEX.

  5. #5
    Registered User
    Join Date
    09-01-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: 90 day average that changes?

    OOOPS!

    I found these formulas before, but when filling down, they got all buggered. I didn't know you had to copy and past arrays in a special way. That fixed it, thanks so much!

  6. #6
    Registered User
    Join Date
    09-01-2009
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: 90 day average that changes?

    Hmmm, now I keep trying to tinker with "=AVERAGE(INDEX(B2:K2,1,MAX(IF(B2:K2<>"",COLUMN(B2:K2)))-COLUMN(B2)+1-2),INDEX(B2:K2,1,MAX(IF(B2:K2<>"",COLUMN(B2:K2)))-COLUMN(B2)+1))" to make another column to track a 60 day average, but I can't get it to work either. I broke the components down to try and understand whats going on. Could someone please tell me what each argument is doing, and then perhaps by understanding it I can change it correctly? It would be better then copying and pasting and learning nothing anyways.


    Here is how I thought it splits up...

    =AVERAGE
    (INDEX
    (B2:K2,1,MAX(IF(B2:K2<>"",COLUMN(B2:K2)))-COLUMN(B2)+1-2)
    ,INDEX
    (B2:K2,1,MAX(IF(B2:K2<>"",COLUMN(B2:K2)))-COLUMN(B2)+1))

    I thought removing 1 index would only make it average 2 columns, but, it didn't.


    *edit*

    Ok, after typing that all out it dawned on me, I think. I changed it to "=AVERAGE(INDEX(B2:K2,1,MAX(IF(B2:K2<>"",COLUMN(B2:K2)))-COLUMN(B2)+1-1),INDEX(B2:K2,1,MAX(IF(B2:K2<>"",COLUMN(B2:K2)))-COLUMN(B2)+1))"
    Last edited by Alfadirr; 09-01-2009 at 07:49 PM.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: 90 day average that changes?

    Why are you using an Array ?

    The only justification for an Array would be that you do indeed have blanks / non-numerics amongst your data points ? (eg data for Jan, none for Feb, data for Mar etc...)

    If the above is not the case, ie all data points are consecutive they merely start at different points in each row, then for a 60 day average simply use:

    Please Login or Register  to view this content.
    The above will be more efficient.
    Last edited by DonkeyOte; 09-02-2009 at 02:21 AM.

+ 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