![]() |
Sum up a dynamic range
Dear all,
I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
Sum up a dynamic range
Hello
Use a dynamic name for your range using this formula in the "refers To" field: =OFFSET(A1;;;COUNTA(A:A)) Then use this new name in your formula (which obviously must NOT be placed in column A): =Sum(YourName) HTH Cordially Pascal "Peter" a écrit dans le message de news: ... Dear all, I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
Sum up a dynamic range
lastrow = Columns("A:A").Find("*", [A1], , , xlByRows, xlPrevious).Row Range("A" & lastrow+1).formula="=SUM(A1:A" & lastrow & ")" Regards, Stefi €˛Peter€¯ ezt Ć*rta: Dear all, I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
Sum up a dynamic range
How about putting the formula
=SUM(A2:A65535) in the first row, makes it easier to find as well. -- HTH Bob Phillips (remove xxx from email address if mailing direct) "Peter" wrote in message ... Dear all, I want to create a function (maybe just a common IW question in fact) to sum up a column, which have a dynamic number of rows! My user will retrieve data from DB and display in a column, but the number of row of this column is subjected to change, so I can't hardcode "=SUM(A1:A10)" at the end of the column. So I'd like to know how I can sum and display the total right after the last cell of that dynamic column? Thanks, |
All times are GMT +1. The time now is 04:36 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com