Let’s say you have a list of groups with the number of people who have the group; now, you need to write a formula to perform the sum by the group.

For this, you can use SUMIF or SWUMIFS.

## Formula to Sum Values by Group

- Enter SUMIF in a cell.
- Refer to the range (B2:B13) where you have the names of groups.
- Specify the Group name or refer to the cell where you have the group to name.
- Refer to the range (C2:C13) to sum values.
- Close the function and hit enter to get the result.

The moment you hit enter, it returns the sum of the North group in the cell.

And you can drag the formula down to all the groups to get the sum.

`=SUMIF(B2:B13,E3,C2:C13)`

## Sum by Multiple Groups

In the following example, we have two groups with two different columns.

To sum values based on two groups, you need to use SUMIFS instead of SUMIF. In the first criteria, we used Group 1 (Region); in the second, we used Group 2 (Gender).

B2:B13 is the column for Group 1, and C2:C13 is for Group 2.

`=SUMIFS(D2:D13,B2:B13,F3,C2:C13,G2)`

## Get the Excel File

Excel Formulas List

## Related Formulas

- Sum Greater than Values using SUMIF
- Sum Not Equal Values (SUMIFS) in Excel
- SUMIF / SUMIFS with an OR Logic in Excel
- SUMIF with Wildcard Characters in Excel
- SUMIFS Date Range (Sum Values Between Two Dates Array)
- Combine VLOOKUP with SUMIF
- Sum IF Cell Contains a Specific Text (SUMIF Partial Text)
- Sum Values Based on Year (SUMIF Year)
- SUMIF By Date (Sum Values Based on a Date)