I'm trying to create a generalised expense claim form for a group of
people. Each row refers to a particular expense and the user of the form
(the claimant) adds rows as needed, so the actual number of rows is
unknown at the time of creating the form.
What I would like to be able to do is, for example, insert the SUM
function in a particular column to sum all the cells in the column above
it (some may be empty) up to a particular row.
For example, suppose the SUM function is in column C then I would like
to write something like: SUM(C9:C(*-1)) where "*" refers to the row the
SUM function is in after the user has added an unknown number of rows
after row 9. Then, if there were 3 expenses (rows 9, 10 and 11) the
function would turn out to be SUM(C9:C11). I want the function to change
itself.
Is this possible? I can't really believe nobody has needed to do this
sort of thing before.

Signature
Regards, Gary Wooding
(To reply by email, change feet to foot in my address)
** Posted from http://www.teranews.com **
Pete_UK - 30 May 2008 01:23 GMT
You might find it easier to put the SUM function at the top of your
sheet, and then you can set up the formula as:
=SUM(C9:C65536)
That way it doesn't matter how many rows they use below C9. By fixing
the panes at row 2 or below, you can scroll down the sheet and the sum
will always be visible on the top row.
Alternatively, you could use a dynamic named range which automatically
adjusts itself to the amount of data that you have - Chip Pearson
explains how here:
http://www.cpearson.com/excel/named.htm#Dynamic
Hope this helps.
Pete
> I'm trying to create a generalised expense claim form for a group of
> people. Each row refers to a particular expense and the user of the form
[quoted text clipped - 16 lines]
> (To reply by email, change feet to foot in my address)
> ** Posted fromhttp://www.teranews.com**
Ken Johnson - 30 May 2008 01:25 GMT
> I'm trying to create a generalised expense claim form for a group of
> people. Each row refers to a particular expense and the user of the form
[quoted text clipped - 16 lines]
> (To reply by email, change feet to foot in my address)
> ** Posted fromhttp://www.teranews.com**
Maybe...
=SUM(INDIRECT("C9:C" & ROW()-1))
Ken Johnson
Gary Wooding - 30 May 2008 07:34 GMT
> I'm trying to create a generalised expense claim form for a group of
> people. Each row refers to a particular expense and the user of the form
[quoted text clipped - 11 lines]
> Is this possible? I can't really believe nobody has needed to do this
> sort of thing before.
Sorry for the confusion on this thread, but my "preferred" server
(Teranews) messed it up.
I posted the original query via Teranews, but when nothing turned up
after 3 hours, decided that Teranews was misbehaving and posted again
via another server. I also changed the subject to "Processing an unknown
sized array" so as to "keep tabs on it" as it were.

Signature
Regards, Gary Wooding
(To reply by email, change feet to foot in my address)