Setting up columns to show total

  • Thread starter Thread starter Hank Laskin
  • Start date Start date
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.
 
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
 
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()))
 
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
 

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

Back
Top