Calculation Issues

How to Group and Sum Excel Rows Based on Three Matching Columns

Camila MilosovichCamila Milosovich Nov 10, 2026 869 views

Question details

The user needs to group data rows where the values in the first three columns are identical, and then calculate the sum of the fourth column for each resulting group.

How to Group and Sum Rows Based on Three Matching Columns
Product
Excel
Device & OS
not provided
Scenario
Aggregating and consolidating tabular data based on multiple criteria columns.
Observed behavior
Data is listed in individual rows and needs to be consolidated into unique groups (based on 3 columns) with a summed total for the fourth column.
Before you start

Ensure your dataset has clear column headers and no empty rows to prevent errors when creating PivotTables or applying advanced formulas.

Solution 1Recommended

Use a PivotTable to Group and Sum Data

A PivotTable is the fastest, no-code method to group multiple columns and calculate totals without altering your original data.

By placing multiple fields in the 'Rows' area of a PivotTable, you can create a grouped hierarchy. Adjusting the layout to 'Tabular Form' makes it look like a standard flat table.

1
Insert a PivotTable

Select your entire dataset, navigate to the Insert tab on the ribbon, and click PivotTable. Choose to place it on a new or existing worksheet.

2
Add grouping columns

In the PivotTable Fields pane, drag your first three columns into the 'Rows' area in the exact order you want them grouped.

3
Add the value column to sum

Drag the fourth column (the one containing the values you want to total) into the 'Values' area. Ensure it is set to 'Sum' (if it says 'Count', click it, choose Value Field Settings, and change it to Sum).

4
Format as a flat table

To make the PivotTable look like a normal data table, go to the Design tab, click 'Report Layout', and select 'Show in Tabular Form'. Click 'Report Layout' again and choose 'Repeat All Item Labels'.

Use a PivotTable to Group and Sum Data
Subtotals Tip: If you do not want subtotal rows for every group, go to the Design tab, click Subtotals, and select 'Do Not Show Subtotals'.
Efficient Data Analysis

Group and Summarize Data Easily with WPS Spreadsheet

WPS Spreadsheet provides powerful and intuitive tools like PivotTables and advanced dynamic array formulas to help you consolidate multi-column data quickly and accurately.

  1. 1. Open your file: Launch WPS Spreadsheet and open your dataset containing the columns.
  2. 2. Insert PivotTable: Navigate to the Insert tab on the top ribbon and click on 'PivotTable'.
  3. 3. Configure Fields: Drag your three matching columns to the 'Rows' box and the numeric column to 'Values' to get instant grouped sums.
Fully compatible with Microsoft Excel file formats (.xlsx, .xls).Advanced PivotTable features to group, summarize, and format data instantly.Supports complex arrays and multi-condition calculation formulas like SUMIFS.Free, lightweight, and fast performance on large datasets.
microsoft office alternative - wps office

Frequently Asked Questions

Can I sum based on more than three columns?

Yes, both PivotTables and the SUMIFS function can handle dozens of criteria columns. For PivotTables, simply drag additional fields into the Rows area. For SUMIFS, add more criteria range and criteria pairs to the end of the formula.

Why is my PivotTable showing 'Count' instead of 'Sum'?

If your value column contains any blank cells or text values, the PivotTable defaults to counting instead of summing. To fix this, right-click any value in the PivotTable, select 'Summarize Values By', and choose 'Sum'.

Will my grouped data update automatically if I change the original numbers?

If you use the UNIQUE and SUMIFS formula method, the totals will update instantly. If you use a PivotTable or Power Query, you will need to right-click the table and select 'Refresh' to see the updated totals.