Setting up columns to show total

H

Hank Laskin

I am attempting to do the following
in column 1, I want to include an expense and continue adding to the column
additonal expenses

in column 2 I would like it to show a continuous total of each entry I put
into column 1

Could someone please help me setup the proper formula for doing this.
 
G

Gord Dibben

Hank

Assuming expenses entered in column A

In B1 enter =A1

In B2 enter =IF(A2="","",A2+B1)

Drag/copy B2 down as far as you wish.

Column B will show nothing until data is entered in Column A.


Gord Dibben MS Excel MVP
 
R

Roger Govier

Hi Gord

Whilst Ardus' solution has great merit in terms of simplicity, I
remembered a thread where David McRitchie was pointing out that
=SUM($A$A:A1) can be inordinately slow when dealing with large ranges.
Your solution would perform faster for large ranges
I found the thread again and a link is posted below.
http://makeashorterlink.com/?Q64E5205D

Ardus' solution does have considerable merit in being robust against row
insertions and deletions (which yours does not)
and David's proposition uses Offset() which uses a volatile function
which I try to avoid when possible.

I would propose
=SUM(INDEX(A:A,1):INDEX(A:A,ROW()))
 
G

Gord Dibben

Thanks for the input Roger.

Will squirrel away for future reference.

Gord

Hi Gord

Whilst Ardus' solution has great merit in terms of simplicity, I
remembered a thread where David McRitchie was pointing out that
=SUM($A$A:A1) can be inordinately slow when dealing with large ranges.
Your solution would perform faster for large ranges
I found the thread again and a link is posted below.
http://makeashorterlink.com/?Q64E5205D

Ardus' solution does have considerable merit in being robust against row
insertions and deletions (which yours does not)
and David's proposition uses Offset() which uses a volatile function
which I try to avoid when possible.

I would propose
=SUM(INDEX(A:A,1):INDEX(A:A,ROW()))

Gord Dibben MS Excel MVP
 
Top