Summing until the next cell that is not empty

Natit

Board Regular
Joined
Jan 22, 2012
Messages
50
Office Version
  1. 365
Platform
  1. Windows
Hello,
I'm looking for the formula that will sum the cells in column C while column A is empty (or till the next cell in column A that ha value)
In the attached I want the cell C2 to sum the data from c3-c6, cell C7 the sum of C8-c13, cell C14 the sum of C15-C22, and so on/
TIA
Nati
1654070172406.png
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
@Natit Does something like below help?
It may or may not be practical for you to have a formula in C ?

Book1
ABCDE
1
2Data121
311 
41 
57 
62 
7Data266
816 
96 
1012 
117 
1212 
1313 
14Data3166
1529 
169 
1721 
1811 
1921 
2023 
21-3 
2255 
23End 
24 
25 
Sheet1
Cell Formulas
RangeFormula
D2:D25D2=IFERROR(IF(A2="","",SUM(OFFSET(C3,,,MATCH("*",A3:A99,0),1))),"")
 
Upvote 0
Another option
++Fluff.xlsm
ABCD
1
2Data121
311 
41 
57 
62 
7Data266
816 
96 
1012 
117 
1212 
1313 
14Data3166
1529 
169 
1721 
1811 
1921 
2023 
21-3 
2255 
23End 
Data
Cell Formulas
RangeFormula
D2:D23D2=IF(A2="","",IFNA(SUM(C2:INDEX(C3:C99,MATCH("*",A3:A99,0))),""))
 
Upvote 0
Solution
HI,
Both worked perfect.
Now I have to implement it on the real data :)
Thanks a lot
Nati
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
Well guys, I was optimistic, but..
Maybe I didn't explain myself clear, but the formula is suppose to be in column C and to sum the rows beneath until the row where the cell in column A is not empty but not to include it.
In both formulas it sum also the next sum.
So, the formula in cell C14 gives me 166 (the right amount) but the formula in cell C7 gives me 232 (16+6+12+7+12+13+166) instead of 66. Also the formula in cell C2
gives me 253 (11+1+7+2+232) instead of 21.
I hope I made myself clear.
Thanks to you all that help with your answers.
Nati
 
Upvote 0
If you want the formula in col C, then you will either need to add it manually to each blank cell, in which case you can simply specify the range to sum, or you will need a macro to do it.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,028
Members
448,940
Latest member
mdusw

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