Calculate Sum of values based on groupings.

h2lm2t

New Member
Joined
Sep 8, 2007
Messages
4
I am looking for a way/function to calculate SUM values in ColumnC based in the following data:

Column C needs to sum all the values in Column B as long as the grouping in ColumnA is the same.

Each row in Column C generates value 0 if the row1 colA and row2 colA are the same, otherwise it aggregates the sum values with the same group in Column A.

A B C
10 1 0
10 2 0
10 3 0
10 4 10
20 5 0
20 6 11
30 7 0
30 8 0
30 9 0

Please kindly let me know. Thanks in advance!

-Sam
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hello Sam,

Welcome to MrExcel. Assuming your data starts in row 1 try this formula in C1 copied down

=IF(A1=A2,0,SUMIF(A:A,A1,B:B))

Note: this post is duplicated, can you delete the other one, please. [click on the X to delete]
 
Upvote 0
You can adjust accordingly...e.g. if data starts at row 5 then use this formula in C5 copied down

=IF(A5=A6,0,SUMIF(A$5:A5,A5,B$5:B5))
 
Upvote 0

Forum statistics

Threads
1,214,575
Messages
6,120,342
Members
448,956
Latest member
Adamsxl

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