Table of Contents
Calculating the cumulative sum for each group in Excel allows for the efficient and accurate tracking of total values for a given set of data. This process involves adding up the values in a column or row, starting from the first value and continuously adding the next value to the previous sum. By doing this for each group, the cumulative sum for that group is obtained. This method is particularly useful when analyzing data in categories or groups, as it provides a clear understanding of the overall trend and total values for each group. Excel offers various functions and formulas, such as SUM and SUMIF, that can be used to easily calculate the cumulative sum for each group in a spreadsheet. By using these tools, one can quickly and accurately obtain the cumulative sum for any given data set.
Excel: Calculate Cumulative Sum by Group
You can use the following formula to calculate a cumulative sum by group in Excel:
=SUMIF(A$2:A2,A2,B$2:B2)
This particular example assumes that the group values are in column A and the values to sum are in column B.
The following example shows how to use this formula in practice.
Example: Calculate Cumulative Sum by Group in Excel
Suppose we have the following dataset that shows the points scored by basketball players on various teams:

Suppose we would like to calculate the cumulative points for each team.
We can type the following formula into cell C2 to do so:
=SUMIF(A$2:A2,A2,B$2:B2)
We can then click and drag this formula down to each remaining cell in column C:

Column C displays the cumulative points values for each team.
For example:
- The cumulative points for Mavs is: 22, 36, 56
- The cumulative points for Warriors is: 17
- The cumulative points for Hawks is: 33, 53, 77
- The cumulative points for Kings is: 28, 53
- The cumulative points for Blazers is: 18, 31, 41
Notice that the values in the cumulative sum column restart for each new team name.
Note: This formula works even if each of the team names are not grouped together.
The following tutorials explain how to perform other common operations in Excel:
Cite this article
stats writer (2024). How can I calculate the cumulative sum for each group in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-i-calculate-the-cumulative-sum-for-each-group-in-excel/
stats writer. "How can I calculate the cumulative sum for each group in Excel?." PSYCHOLOGICAL SCALES, 23 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-i-calculate-the-cumulative-sum-for-each-group-in-excel/.
stats writer. "How can I calculate the cumulative sum for each group in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-i-calculate-the-cumulative-sum-for-each-group-in-excel/.
stats writer (2024) 'How can I calculate the cumulative sum for each group in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-i-calculate-the-cumulative-sum-for-each-group-in-excel/.
[1] stats writer, "How can I calculate the cumulative sum for each group in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can I calculate the cumulative sum for each group in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
