Use SUMIF in Excel to Sum Rows with Matching Names
Question details
Sum values associated with matching names without writing a separate formula for each name.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet has more than 1,400 rows and approximately 500 names. Names are in column D and values to sum are in column H.
- Observed behavior
- The desired result is a total for each matching name, either beside each row or in a summary report.
Confirm that column D contains the names, column H contains numeric values, and row 2 is the first data row. Make sure column U is available for the formula, or choose another empty column.
Use SUMIF to Show Each Name's Total on Every Row
Use one formula when you want the total for each row's name displayed beside the original data.
Select cell U2 and enter =SUMIF(D:D,D2,H:H). The formula matches the name in D2 against column D and sums the corresponding values in column H.
Select U2 and drag the fill handle down to the last data row, or double-click the fill handle to fill alongside a continuous column of data.
Compare the results in column U for rows with the same name. Each matching row should display the same total.

Create a PivotTable with One Total per Name
Use a PivotTable when you want a separate summary showing each name once.
Sum Matching Names in WPS Spreadsheet
Open your worksheet in WPS Spreadsheet and use the same SUMIF formula to calculate totals for matching names.
- 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
- 2. Enter SUMIF: Select U2 and enter =SUMIF(D:D,D2,H:H), assuming names are in column D and values are in column H.
- 3. Fill the formula down: Select U2 and drag its fill handle down through the remaining data rows.
- 4. Save the workbook: Choose File > Save or Save As and select the Excel workbook format if you want to keep an XLSX file.

Frequently Asked Questions
What does =SUMIF(D:D,D2,H:H) calculate?
It checks column D for values matching D2 and adds the corresponding numeric values from column H.
Why does the same total appear on multiple rows?
Each formula uses the name on its own row, so rows with the same name return the same total. For a list with one row per name, use Insert > PivotTable.
Why does my PivotTable show a count instead of a sum?
Open Value Field Settings for the column H field in the Values area and select Sum. Also check that the source values in column H are numeric.
Can I use the formula if my names and values are in different columns?
Yes. Replace D:D with the names column, D2 with the first name cell, and H:H with the values column. Enter the adjusted formula in an empty cell and fill it down.




