Tough one: Summing a variable range

Innoguide

Board Regular
Joined
Sep 13, 2011
Messages
159
Hi -

Does any one know what formula would allow me to sum only a portion of a column based on the values in adjacent rows.

If the value in column A is N, and the value in Column B is X, I need the formula to sum the results of column C for that row and all of the following contiguous rows in which the value of row A is N but the value in row B is not X.

I haven't figured out how to use Sumif since it sums all the results where column A is N and B is not X - not just the contiguous ones.

Thanks in advance!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Hi -

Does any one know what formula would allow me to sum only a portion of a column based on the values in adjacent rows.

If the value in column A is N, and the value in Column B is X, I need the formula to sum the results of column C for that row and all of the following contiguous rows in which the value of row A is N but the value in row B is not X.

I haven't figured out how to use Sumif since it sums all the results where column A is N and B is not X - not just the contiguous ones.

Thanks in advance!
Can you post some sample data and let us know what result you expect?
 
Upvote 0
Can you post some sample data and let us know what result you expect?

Here's the data (, indicates next column, B means blank,column D is the result)

Y,B,5,=B
N,X,3,=3+5+4
N,B,5,=B
N,B,4,=B
N,X,8,=8
N,X,7,=7+1
N,B,1,=B
Y,B,7,=B

Sorry for the format
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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