+ Reply to Thread
Results 1 to 14 of 14

Dynamically sum a column

  1. #1
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Dynamically sum a column

    Hello,

    I have a data from Column G to AV.
    I would like to dynamically SUM column G based on the total rows count.
    I want the result to be display in the last available row of Column G.

    for example if the total count of column g is from G2:G99, i want the result to be display in G100 using the below formula:
    Please Login or Register  to view this content.
    Thanks in advance gurus!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,166

    Re: Dynamically sum a column

    Select Cell A1 and use the Name Manager to create a Named Range: ptrFirstCell =
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Now, select A2 and use the Name Manager to create a Named Range: ptrPrevCell =
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You can now use the formula in any cell, except row 1 (in any column) and it will sum all the cells from row 1 to the row before the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you put the formula in row 1 it will generate a circular reference.

    Courtesy the book: Progessional Excel Development by Buulen, Bovey and Green

    You can insert rows up to, and including the cell with the formula

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Dynamically sum a column

    Hi TMS,

    thanks for reply. Is it possible to convert it to vba? This is just a part of I want to automate.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Dynamically sum a column

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Dynamically sum a column

    It works John!

    how can I modify it if I want it until last row of column AV?

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Dynamically sum a column

    Maybe:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Dynamically sum a column

    Quote Originally Posted by JOHN H. DAVIS View Post
    Maybe:

    Please Login or Register  to view this content.
    Hi John,

    When I try the above code, it total only Column G.

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Dynamically sum a column

    My mistake, I thought you only wanted the last row value of AV. Try

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Dynamically sum a column

    Or are you trying to plant the formula accross from G to AV? Do all the columns hold numeric values?

  10. #10
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Re: Dynamically sum a column

    Quote Originally Posted by JOHN H. DAVIS View Post
    Or are you trying to plant the formula accross from G to AV? Do all the columns hold numeric values?
    That's right john. Across G to AV. Yes, they all hold numeric values.

  11. #11
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,166

    Re: Dynamically sum a column

    Maybe this, then:

    Please Login or Register  to view this content.

    Regards, TMS

  12. #12
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Dynamically sum a column

    Maybe:

    Please Login or Register  to view this content.

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,166

    Re: Dynamically sum a column

    Hi John: would you not expect to put all the column totals on the same row?

  14. #14
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Dynamically sum a column

    I would, but I don't know the layout. If the columns are the same size, then they will be on the same row.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Dynamically match Column header text to sum column on another worksheet
    By swiftrain in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-20-2015, 04:50 PM
  2. How to dynamically apply the Row and column name
    By DURGESH88 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-24-2014, 02:26 AM
  3. Replies: 1
    Last Post: 02-21-2013, 06:37 PM
  4. How to update a column dynamically depending on other column
    By krishnamohan in forum Excel General
    Replies: 0
    Last Post: 08-10-2010, 04:32 PM
  5. Add numbers dynamically down a column
    By hutch@edge.net in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-20-2009, 08:57 PM

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