+ Reply to Thread
Results 1 to 5 of 5

sum a dynamic range

  1. #1
    Registered User
    Join Date
    04-24-2010
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    3

    sum a dynamic range

    Hi,

    i am trying to get the last number in a column and get the sum result of that number up to 10 rows before.

    so far i have this:
    =INDIRECT(ADDRESS( MATCH( 9.99E306, C:C,1),3,4) )
    which correctly gives me the value of the last row to contain data in a column

    now what i am trying to do is to get the sum of a range that would go from the cell id in the above statement up to 10 rows before.

    i guess it would look something like this
    =SUM(INDIRECT(ADDRESS( MATCH( 9.99E306, C:C,1),3,4):R-10C)
    this does not work and i am not to familiar with relative cells coordinates.

    thanks for any help

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: sum a dynamic range

    ADDRESS gives you a cell value as a text string and then INDIRECT converts it back to a cell reference, best to avoid both those functions and use either OFFSET or INDEX, e.g.

    =SUM(OFFSET(C1,MATCH(9.99E+306,C:C)-1,0,-10))

  3. #3
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: sum a dynamic range

    Try this non volatile formula:

    =SUM(INDEX(C:C,MATCH(10^10,C:C)-9):INDEX(C:C,MATCH(10^10,C:C)))

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

    Re: sum a dynamic range

    If you don't have blank cells you could use this:

    =SUMPRODUCT(A1:A1000, --(ROW(A1:A1000)>COUNT(A1:A1000)-10))

  5. #5
    Registered User
    Join Date
    04-24-2010
    Location
    montreal
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: sum a dynamic range

    Thanks People... works very well!

+ 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