+ Reply to Thread
Results 1 to 8 of 8

Calculating value for maximum consecutive value

  1. #1
    Registered User
    Join Date
    07-25-2010
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Post Calculating value for maximum consecutive value

    Hi

    I use MS 2007. I try to create formula to find the average of maximum consecutive value. According to my sample, I would like to get the average of maximum consecutive value from range a:p ;

    PHP Code: 
    To give more ideathe example is
             a  b  c  d  e  f  g h  i   k  l  m  n  o  p               q             r
    firm                                                                maxyr       avr
    xxxx   1   2  0  0  5  2  3  9 0  0  0  3   4 5   0                 4         
    (5+2+3+9)/4
    xxxy   0   0  0   4  3 0  0  0 4  5  0  0   0 0   0                 2         
    ((4+3)/2) +((4+5)/2)
    xxxz   0   5  2   4  5 3  0  0  0 6  7  0   0  0  0                 5         (5+2+4+5+3)/

    How to get the formula for column r? Any help will be appreciated.

    Note: I also attach my original excel file. In this original file, I would like to get the formular for column AM (AvrMx)
    Attached Files Attached Files
    Last edited by than_k22; 07-25-2010 at 07:01 PM.

  2. #2
    Registered User
    Join Date
    07-15-2010
    Location
    Daegu, Korea
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Calculating value for maximum consecutive value

    Hi..
    Please check attachment
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-25-2010
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Calculating value for maximum consecutive value

    Quote Originally Posted by rethguals View Post
    Hi..
    Please check attachment

    Thanks a lot for your advice, rethguals. I look through the file but there is still a point. For example, row44, there are two 2 consecutive runs as the maximum run. The sum shall be divided by 4, instead of 2. Any help will be appreciated.

  4. #4
    Registered User
    Join Date
    07-15-2010
    Location
    Daegu, Korea
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Calculating value for maximum consecutive value

    Put in =IF(AI2=0,0,AP2/(AI2*COUNTIF(AJ2:AL2,">0"))) in AQ2

    But your question was...
    a b c d e f g h i k l m n o p q r
    0 0 0 4 3 0 0 0 4 5 0 0 0 0 0 2 ((4+3)/2) +((4+5)/2)

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

    Re: Calculating value for maximum consecutive value

    than_k22

    Using your original sample file (you don't really need S:AH) but leaving them in for the time being for sake of continuity the following single cell calcs should do what you want:

    Please Login or Register  to view this content.
    For the average of the Max run(s)

    Please Login or Register  to view this content.
    I have little doubt there is a more efficient method for the Average however.

    edit: in retrospect I'm not sure the Average calc does exactly what you want re: multiple "maximum" runs ... ie 2 runs of 2
    the array above will average the values of the run that has the highest aggregate value as opposed to the average of all of the averages...
    let us know.
    Last edited by DonkeyOte; 07-26-2010 at 04:33 AM.

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

    Re: Calculating value for maximum consecutive value

    Per my edit... you could store the count of streaks to simplify the AVG calc, eg:

    Please Login or Register  to view this content.
    Then modify the AVG calc accordingly

    AM2:

    Please Login or Register  to view this content.
    Last edited by DonkeyOte; 07-26-2010 at 07:36 AM. Reason: edit: removed weighting point as not relevant given same no. terms per streak

  7. #7
    Registered User
    Join Date
    07-25-2010
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Calculating value for maximum consecutive value

    Hi, rethguals, donkeyote.. Thank you so much for your advise. the issue is solved

  8. #8
    Registered User
    Join Date
    07-25-2010
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Calculating value for maximum consecutive value

    wrong post
    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