Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a column of data in the following general format:

2000
1000
500
300
1500

c
a


1000
1500
1250
3000


4000
6500

3000

1000
1000
1000

f


4500
1500
3000
3000
2000

There is no pattern to the number of entries in each 'block', the number of spaces between blocks, or the number of non-numeric characters between blocks. What I would like to be able to do is sum each of the 'blocks and place the result beside its respective block. Is there a way to do this without VBA?

share|improve this question
up vote 10 down vote accepted

In B2 enter:

=IF(AND(ISNUMBER(A2),NOT(ISNUMBER(A3))),SUM($A$1:A2)-SUM($B$1:B1),"")

and copy down:

enter image description here

share|improve this answer
1  
You can also use Ctrl-D in Excel to 'Fill Down' if the column is long and you don't want to scroll to find the end to copy down. – jhaagsma Mar 4 at 20:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .