fred
i think a dynamic range will give you what you need. go here to see how it's done:
14626b.html
A named dynamic range would "require" that you do the summing NOT in a cell of a column where the numbers to sum are.
Aladin
Aladin - I didn't know that - thanks for clarifying
In instances like yours I create a relative range, "CellUp", that's defined as 1 cell above the current cell. Assuming your active cell is A11 put =A10 (no $ signs) in the "Refers to:" of the Define Name box. Then use SUM(A1:CellUp) in A11. I need to be able to sum a column of values, e.g.,
Re: Aladin - I didn't know that - thanks for clarifying
Thanks to all that replied.
I was hoping for something rather simple like:
=SUM(A1:ADDRESS(ROW()-1,COLUMN())
which doesn't work, presumably due to lack of
'text' to 'reference' type conversion (How do you do that?)
Named ranges don't appear to dynamically update
after a row is inserted through it until after a file save as in SUM(Prices) where 'Prices' is the
column header text
Fred, I was hoping for something rather simple like: =SUM(A1:ADDRESS(ROW()-1,COLUMN()) which doesn't work, presumably due to lack of
That would be:
=SUM(A1:INDIRECT(ADDRESS(ROW()-1,1)))
or
=SUM(INDIRECT("A1:"&ADDRESS(ROW()-1,1)))
What Scott R gave you is much better, if you insist on having the SUM formula immediately after your last entry. Named ranges don't appear to dynamically update
You're right about "named ranges". Anno wanted you to use something different: a named *dynamic* range.
Activate Insert|Name|Define.
Enter Prices for Names in Workbook [ if this name is already there, keep it. ]
Enter (or Change what is already there to) for Refers To:
=OFFSET(x!$A$1,0,0,COUNTA($A:$A),1)
x stands for the name of the worksheet you're in.
Put =SUM(Prices) anywhere except where prices are.
Just watch it while you insert values or rows with values in or delete values or rows with values from anywhere in column A.
Aladin
Thanks very much Scott R and Aladin, this works ok.
Fred.