+ Reply to Thread
Results 1 to 5 of 5

Average on the 6 latest figures of a list where figures keep being added

Hybrid View

  1. #1
    Registered User
    Join Date
    03-26-2009
    Location
    Luxembourg, Luxembourg
    MS-Off Ver
    Excel 2002
    Posts
    3

    Smile Re: Average on the 6 latest figures of a list where figures keep being added

    Well, thanks for your reply, in principle, it works. My problem is the following: if at all possible, I think I'd limit the range of the cells storing data to A1 - A99, continue to have only the 6 latest figures taken into consideration for the average calculation, and then on cell A100, I'd like to have this function running.

    But I notice if I merely try to adjust your formula so as to refer to only part of a column, the result is crooked. Any suggestion?

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

    Re: Average on the 6 latest figures of a list where figures keep being added

    I'm not quite sure how you went about it... if you change every reference of A:A to A1:A99 it should work, eg:

    A100:
    =AVERAGE(INDEX(A1:A99,MATCH(9.99999999999999E+307,A1:A99)-5):INDEX(A1:A99,MATCH(9.99999999999999E+307,A1:A99)))

    However it would not work if you had < 6 values in your range... so you could introduce a MIN clause to average at most 6 values or at least x values where x is determined by the number of values in the range if less than 6, eg:

    =AVERAGE(INDEX(A1:A99,MATCH(9.99999999999999E+307,A1:A99)-MIN(5,COUNT(A1:A99)-1)):INDEX(A1:A99,MATCH(9.99999999999999E+307,A1:A99)))

    And perhaps add one further test to ensure you have at least one number in the range

    =IF(COUNT(A1:A99),AVERAGE(INDEX(A1:A99,MATCH(9.99999999999999E+307,A1:A99)-MIN(5,COUNT(A1:A99)-1)):INDEX(A1:A99,MATCH(9.99999999999999E+307,A1:A99))),"")

  3. #3
    Registered User
    Join Date
    03-26-2009
    Location
    Luxembourg, Luxembourg
    MS-Off Ver
    Excel 2002
    Posts
    3

    Smile Re: Average on the 6 latest figures of a list where figures keep being added

    Hi! Your latest suggestion is just perfect! Thanks for your precious help!

    Patounet527

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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