Multiple Subtotals in Column separated by formatted rows

angel585858

New Member
Joined
Jun 18, 2020
Messages
5
Office Version
  1. 2013
Platform
  1. Windows
I have a spreadsheet that i need to add multiple subtotals in the same column above ranges of cells separated by formatted rows. The number of rows change every month so it would need to be dynamic.
I am not able to use sumifs as several ranges contain the same description. Is there a formula that can do this?
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Here is an example of what I am trying to do, the subtotals are on top and new lines are added each month so the range is variable.
I am trying to subtotal the lines beneath the blue line until the next blue line.
1592528932592.png
 
Upvote 0
Copying your data, I put "N1" in cell A2.

Try this:

=SUM(INDIRECT(ADDRESS(ROW(A8),COLUMN(C6))&":"&ADDRESS(MATCH(INDEX($A8:$A105,MATCH(FALSE,ISBLANK($A8:$A105),0)),$A:$A,0)-1,COLUMN(C6))))

You'll need to use Shift+Ctrl+ENTER to get it working, then just copy/paste the cell from there
 
Upvote 0
Copying your data, I put "N1" in cell A2.

Try this:

=SUM(INDIRECT(ADDRESS(ROW(A8),COLUMN(C6))&":"&ADDRESS(MATCH(INDEX($A8:$A105,MATCH(FALSE,ISBLANK($A8:$A105),0)),$A:$A,0)-1,COLUMN(C6))))

You'll need to use Shift+Ctrl+ENTER to get it working, then just copy/paste the cell from there
Thanks for your help! This worked great!
 
Upvote 0

Forum statistics

Threads
1,214,645
Messages
6,120,711
Members
448,984
Latest member
foxpro

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