Table of Contents
Calculating the sum by group in Excel refers to the process of finding the total value of a specific set of data that is grouped or categorized together. This can be achieved by using the SUM function in Excel, which allows you to specify a range of cells to be added together. By grouping your data, you can easily calculate the sum for each group, providing valuable insights and analysis. This feature is particularly useful for managing large datasets and organizing information in a meaningful way. With the right techniques, you can efficiently calculate the sum by group in Excel and make more informed decisions based on your data.
Calculate the Sum by Group in Excel
You can use the following simple formula to calculate the sum of values by group in an Excel spreadsheet:
=SUMIF(group_range, "group name", sum_range)
The following example shows how to use this formula in practice.
Example: Sum by Group in Excel
Suppose we have the following dataset that shows the total points scored by 15 different basketball players:

Now suppose we’d like to find the sum of the points scored, grouped by team.
To do so, we can use the =UNIQUE() function to first create a list of the unique teams. We’ll type the following formula into cell F2:
=UNIQUE(B2:B16)
Once we press enter, a list of unique team names will be displayed:

Next, we can use the =SUMIF() function to find the sum of points scored by players on each team.
We’ll type in the following formula into cell G2:
=SUMIF(B2:B16, F2, C2:C16)
We’ll then copy and paste this formula into the remaining cells in column G:

Column F displays each of the unique teams and column G displays the sum of the points scored by each team.
Cite this article
stats writer (2024). How do I calculate the sum by group in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-do-i-calculate-the-sum-by-group-in-excel/
stats writer. "How do I calculate the sum by group in Excel?." PSYCHOLOGICAL SCALES, 30 Apr. 2024, https://scales.arabpsychology.com/stats/how-do-i-calculate-the-sum-by-group-in-excel/.
stats writer. "How do I calculate the sum by group in Excel?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-do-i-calculate-the-sum-by-group-in-excel/.
stats writer (2024) 'How do I calculate the sum by group in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-do-i-calculate-the-sum-by-group-in-excel/.
[1] stats writer, "How do I calculate the sum by group in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, April, 2024.
stats writer. How do I calculate the sum by group in Excel?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
