Formula to subtotal previous column that dynamically changes so need to find blanks to know which rows to subtotal

bjurick

New Member
Joined
Feb 27, 2012
Messages
3
What is the formula that I can use in Column C? I don't want to have to change any cell references as this data changes all the time so it will have to be smart enough to detect blank cells in column B and then place the subtotal in column C. Also, the subtotal in column C is only for a "dynamic" range in between the blank cells in column B. Any help would be greatly appreciated.
A
B
C
Item 1
200.00
Item 2
300.00
Total
500.00
Item 3
100.00
Item 4
500.00
Item 5
400.00
Total
1000.00
Item 6
100.00
Item 7
150.00
Item 8
250.00
Item 9
300.00
Total
800.00

<tbody>
</tbody>
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
<br />
Book1
ABC
1Item 1200
2Item 2300 
3Total500
4
5Item 3100
6Item 4500
7Item 5400
8Total1000
9
10Item 6100
11Item 7150
12Item 8250
13Item 9300
14Total800
15
16
Sheet1
Cell Formulas
RangeFormula
C2=IF(AND(B1<>"",B2=""),SUM($B$1:B2)-SUM($C$1:C1),"")


Copy the C2 formula down column C
 
Upvote 0
ABC
1Item 1200
2Item 2300
3Total500
4
5Item 3100
6Item 4500
7Item 5400
8Total1000
9
10Item 6100
11Item 7150
12Item 8250
13Item 9300
14Total800
15
16

<colgroup><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>


Worksheet Formulas
CellFormula
C2=IF(AND(B1<>"",B2=""),SUM($B$1:B2)-SUM($C$1:C1),"")

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Copy the C2 formula down column C

Excellent. Thank you so much. Works great!!
Thanks
 
Upvote 0

Forum statistics

Threads
1,215,480
Messages
6,125,050
Members
449,206
Latest member
Healthydogs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top