Pivot Table Issues

Calculate Totals for Unique Labels in Excel with a PivotTable

Huma Ashraf ChHuma Ashraf Ch Nov 12, 2026 868 views

Question details

Create a summary that lists each unique label once and calculates the total of all values associated with that label.

Calculate Totals for Each Unique Label in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
The source data contains duplicate labels, such as brands, and a numeric column such as clicks that must be totaled by label.
Observed behavior
The desired result is one row per unique label with the sum of its related numeric values.
Before you start

Make sure your source table has a header row and that the value column contains real numbers rather than text. Remove blank rows within the data range before creating a PivotTable.

Solution 1Recommended

Create a PivotTable to total values by each unique label

Use this method when you need a flexible summary that can be sorted, filtered, and refreshed as the source data changes.

A PivotTable groups duplicate labels automatically. Place the label field in Rows and set the numeric field in Values to Sum to show one total for every label.

1
Select the source data

Click any cell in the data range that contains the label column, such as Brand, and the numeric column, such as Clicks.

2
Insert a PivotTable

In Excel, open Insert > PivotTable, confirm the table or range, choose where to place the PivotTable, and select OK.

3
Add the label field to rows

In the PivotTable Fields pane, drag Brand or your label field to the Rows area.

4
Add the numeric field to values

Drag Clicks or your numeric field to the Values area. Excel should display Sum of Clicks.

5
Confirm the summary calculation

If the field displays Count instead of Sum, select the value field, choose Value Field Settings, select Sum, and choose OK.

Create a PivotTable to total values by each unique label
Unique-label totals are ready: The PivotTable now displays every label once and calculates the combined value for all matching source rows.
WPS Spreadsheets

Summarize Unique Labels and Totals with a WPS Spreadsheet PivotTable

WPS Spreadsheets lets you group duplicate labels and calculate their totals in a PivotTable. Create a pivot from your data, place the label in Rows, and add the numeric field as a Sum value to build an editable summary quickly.

  1. 1. Select the data range: In WPS Spreadsheets, click a cell inside the range containing your label and value columns.
  2. 2. Create a PivotTable: Go to Insert > PivotTable and confirm the source range and destination.
  3. 3. Add the label as a row field: In the PivotTable field list, drag the label field, such as Brand, to the Rows area.
  4. 4. Add the values as a sum: Drag the numeric field, such as Clicks, to the Values area, then select Value Field Settings and choose Sum if needed.
Group repeated labels into one summarized row.Calculate Sum totals for clicks, sales, quantities, and other numeric fields.Open and edit Microsoft Excel .xlsx and .xls files with compatible spreadsheet workflows.Use a familiar spreadsheet interface to create, sort, and refresh PivotTables.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PivotTable show Count instead of Sum?

Excel uses Count when it detects nonnumeric entries in the source field. In the PivotTable, select the value field, choose Value Field Settings, and select Sum. Also check that the source values are stored as numbers.

How do I refresh totals after adding more source data?

Click inside the PivotTable and choose PivotTable Analyze > Refresh. For expanding datasets, convert the source range to a table first through Insert > Table so new rows are included more easily.

Can I sort the unique labels by their total values?

Yes. Right-click a number in the PivotTable total column, select Sort, and choose Largest to Smallest or Smallest to Largest.

What Excel version is required for the UNIQUE and HSTACK formula?

The formula requires a version of Excel that supports dynamic arrays, including UNIQUE and HSTACK, such as Microsoft 365. If those functions are unavailable, use a PivotTable or create a unique-label list and apply SUMIF.