Sum a range of cells while adjacent cells are blank and then stop when a non blank cell exists.

rob_sheeds

Board Regular
Joined
Dec 9, 2010
Messages
57
Hi,
I need to sum a range of cells while a range of adjacent cells are blank. I want to sum them until I hit a non blank cell.
Though of using offset but all I could do would be ignore blanks. I need to sum range to stop when it hits a blank.
Eg.
So basically in the last right cell for example I want to sum the amount column from 15/01/2012 up until but not including the 10/01/2012 or when it hits the first non-blank.....
Thanks in advance!!!!!!

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Amount
[/TD]
[TD]Amount
[/TD]
[TD]Result
[/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]1/01/2012
[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]120
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]200
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]500
[/TD]
[TD]10/01/2012
[/TD]
[TD]820
[/TD]
[/TR]
[TR]
[TD]150
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]230
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]300
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]600
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]15/01/2012
[/TD]
[TD]1380
[/TD]
[/TR]
</tbody>[/TABLE]
 
Hi,
I need to sum a range of cells while a range of adjacent cells are blank. I want to sum them until I hit a non blank cell.
Though of using offset but all I could do would be ignore blanks. I need to sum range to stop when it hits a blank.
Eg.
So basically in the last right cell for example I want to sum the amount column from 15/01/2012 up until but not including the 10/01/2012 or when it hits the first non-blank.....
Thanks in advance!!!!!!

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Amount
[/TD]
[TD]Amount
[/TD]
[TD]Result
[/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]1/01/2012
[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]120
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]200
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]500
[/TD]
[TD]10/01/2012
[/TD]
[TD]820
[/TD]
[/TR]
[TR]
[TD]150
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]230
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]300
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]600
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]15/01/2012
[/TD]
[TD]1380
[/TD]
[/TR]
</tbody>[/TABLE]

C2, copied down:

=IF($B2="","",SUM($A$1:A2)-SUM($C$1:C1))
 
Upvote 0
Hi,
I need to sum a range of cells while a range of adjacent cells are blank. I want to sum them until I hit a non blank cell.
Though of using offset but all I could do would be ignore blanks. I need to sum range to stop when it hits a blank.
Eg.
So basically in the last right cell for example I want to sum the amount column from 15/01/2012 up until but not including the 10/01/2012 or when it hits the first non-blank.....
Thanks in advance!!!!!!

[TABLE="class: grid, width: 500"]
<TBODY>[TR]
[TD]Amount
[/TD]
[TD]Amount
[/TD]
[TD]Result
[/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]1/01/2012
[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]120
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]200
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]500
[/TD]
[TD]10/01/2012
[/TD]
[TD]820
[/TD]
[/TR]
[TR]
[TD]150
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]230
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]300
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]600
[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]100
[/TD]
[TD]15/01/2012
[/TD]
[TD]1380
[/TD]
[/TR]
</TBODY>[/TABLE]
This formula entered in C2 and copied down:

=IF(B2="","",SUM(A$2:A2)-SUM(C$1:C1))
 
Upvote 0

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