Summing Between Blanks

Gakinmiff

New Member
Joined
Oct 20, 2006
Messages
6
In column L, I want to create a function where if the cell next to it in column K is >0, then it is 0, but if it is =0, then it adds all the cells going up to the next cell which =0 So since K10 and K4 =0, L10 is the sum of K5:K9. But then once it finds the next cell=0 I don't want it does to look further.

A string of IF statements only goes so far (I think 6 nested statements). Any thoughts?
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
L2:

=MATCH(TRUE,K2:K100<>0,0)

L3:

=MATCH(TRUE,INDEX(K2:K100,L2):K100=0,0)+L2-1

L4:

=SUM(INDEX(K2:K100,L2):INDEX(K2:K100,L3-1))

Every formula above needs to be confirmed with cntrol+shift+enter, not just with enter.

L4 comes to house the desired result.
 
Upvote 0

Forum statistics

Threads
1,215,398
Messages
6,124,688
Members
449,179
Latest member
kfhw720

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