Originally Posted by
cantosh
Be sure that you're NOT entering the formula in the very first row in which you need it. Enter it in 'B2' or somewhere else down the line. As to walking you through the formula, Phuocam's rather clever solution is easier to dissect than mine, so let's break down that formula:
=IF(AND(A2="",A1<>""),SUM($A$1:A1)-SUM($B$1:B1),"")
In B2, if A2 is blank AND A1 is not (indicating a break in your string of numbers in A), then the formula will add together all of the values in A up to that point and subtract all of the values in B to that point, returning the solution in column B. If A2 is not blank, then the corresponding B2 entry will be blank. Essentially, each of your subtotal entries in B will be the sum of ALL previous values in A minus the previous subtotals in B, leaving the difference, which is the sum of the values in A since the last break. If you're going to modify your range, enter the formula in the column in which you want the subtotals, but NOT in the first cell in that range. Pick a cell in the middle, we'll call it row X. Change all of the "A" entries in the formula to whatever column has your values. Change row 2 in the formula to correspond to row X. Change row 1 in the formula to correspond to X-1.
I hope that makes sense? If it doesn't, post what the new range is and we can deal in specifics.
Bookmarks