+ Reply to Thread
Results 1 to 6 of 6

Thread: Find last 20 values in column

  1. #1
    Registered User
    Join Date
    03-05-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Find last 20 values in column

    Hi Guys,
    I have a single column of numbers ~100 rows high.. Each week an extra number is added at the bottom of the list. Not all cells have values in them but I need to do calculations on the last 20 cells that do have values in them..

    Thanks,
    Doggy

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Find last 20 values in column

    A few ways, one might be:

    =SUM(INDEX($A$1:$A$100,LARGE(INDEX(ISNUMBER($A$1:$A$100)*ROW($A$1:$A$100),0),MIN(20,COUNT($A$1:$A$100)))):$A$100)
    Note: I'm curious that you say you have 100 rows but that new numbers are added each week... the implication is that the size of the range is not fixed.

  3. #3
    Forum Guru sweep's Avatar
    Join Date
    04-03-2007
    Location
    Location: Location:
    MS-Off Ver
    3.0
    Posts
    2,472

    Re: Find last 20 values in column

    Along similar lines:

    =SUM(LOOKUP(LARGE(ISNUMBER(A1:A1000)*ROW(A1:A1000),{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20}),ROW(A1:A1000),A1:A1000))
    Please disregard anything in the above post. It may well have been edited without my consent, as has been the case with several posts and threads recently.

  4. #4
    Registered User
    Join Date
    03-05-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Find last 20 values in column

    Thanks guys...
    Just reading back over my post, I don't think I explained it very well..
    The formula I need is for a golf handicapping system..
    How it works is that each player's score 'over par' each week is put in the next cell down, eg, if a player scores 90 on a course rated at 72, then his score for that game is 18..(if a particular player doesn't play the cell is left blank.)
    To calculate the player's handicap, his 20 most recent scores are taken, of which the 10 lowest scores are added together, multiplied by 0.96, divided by 10 and then the integer of that is his 'new' handicap..
    So it's a 'rolling' handicap system..

    I hope that makes a bit more sense..

    Thanks again,
    Doggy

  5. #5
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,423

    Re: Find last 20 values in column

    If I've understood...

    =INT((0.96*SUMPRODUCT(SMALL(INDEX($A$1:$A$100,LARGE(INDEX(ISNUMBER($A$1:$A$100)*ROW($A$1:$A$100),0), MIN(20,COUNT($A$1:$A$100)))):$A$100,ROW($1:$10))))/10)

    Again the ranges will need to be modified I suspect - but try to keep as lean as possible.

  6. #6
    Registered User
    Join Date
    03-05-2010
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Find last 20 values in column

    Thanks Donkey, exactly what I was looking for!

    Thanks to you too Sweep!

    Doggy

+ 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.2.0