Cell Referencing - Cumulative Total

G

GarryR

I have a table that we populate with data from our SQL server. In this table
we have a 'Line Total' field, how can I reference this field in a new column
to it's right that shows the cumulative total of the table cell to it's
immediate left (see example)

Cell Header 1 Cell Header 2
100.00 100.00
50.00 150.00
75.00 225.00
-100.00 125.00

Have tried various attempts with {=sum(Cell2:Cell10)} etc... but the results
are not what we need to show.
 
G

Graham Mayor

The cells in the First Column (A) are numbered from 1 to 5 etc
so in Column 2 (B)

Cell Header 2
{ =A2 }
{ =A2 + A3 } OR { =SUM(A2:A3) }
{ =A2 + A3 + A4 } OR { =SUM (A2:A4) }
{ =A2 + A3 + A4 + A5 } OR { =SUM(A2:A5) }


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

macropod

Hi Garry

Your problem description suggests you need a mixed absolute & relative cell addressing scheme, such as:
{QUOTE{SET Row {SEQ Row}}{SET RowA "A{=Row}"}{=SUM(A1:{RowA}) \# ,0.00}}
or
{QUOTE{SET RowA "A{={SEQ Row}/2}"}{=SUM(A1:{RowA}) \# ,0.00}}

The above formulae assume your Cell Header 1 values are in A1-An. If your table has a header row and your data start in row 2,
change the formulae to:
{QUOTE{SET Row {SEQ Row}}{SET RowA "A{=Row+1}"}{=SUM(A1:{RowA}) \# ,0.00}}
or
{QUOTE{SET RowA "A{={SEQ Row}/2+1}"}{=SUM(A1:{RowA}) \# ,0.00}}
and, if your Cell Header 1 values are in Column B (ie the 2nd column, change all the 'A's to 'B'.

Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top