How to Fix Duplicate Items in Excel Pivot Tables
Question details
The Pivot Table displays duplicate entries for seemingly identical items due to invisible spaces or non-printing characters in the source data.

- Product
- Spreadsheet
- Device & OS
- not provided
- Scenario
- Grouping, summarizing, and analyzing data using a Pivot Table.
- Observed behavior
- Two or more identical-looking items appear as separate rows or columns in the Pivot Table because of hidden formatting differences.
Ensure you have access to the original source data table connected to your Pivot Table, as fixing this issue requires modifying and cleaning the raw data.
Clean Source Data with TRIM and CLEAN Formulas
Use spreadsheet formulas to strip out invisible spaces and non-printing characters from your source data.
Duplicate items that look exactly the same usually differ by a trailing space or a hidden non-printable character. The best way to resolve this is by standardizing the text in your source data.
Navigate to your source data sheet and insert a new blank column directly next to the column containing the duplicate values.
In the first cell of the new column, enter the formula =TRIM(CLEAN(A2)) (assuming A2 is the first cell with data) and press Enter.
Click the small square at the bottom right corner of the cell and drag it down to apply the formula to all rows.
Copy the newly cleaned data. Right-click the original data column, select 'Paste Special', and choose 'Values' to overwrite the uncleaned text.
Go back to your Pivot Table, right-click anywhere inside it, and select 'Refresh'. The duplicate items will now merge into a single entry.

Use Find and Replace to Remove Typos
Quickly consolidate items if you know the exact typo or spacing error causing the duplicate.
Clean Data and Build Pivot Tables in WPS Spreadsheet
WPS Spreadsheet provides powerful data cleaning formulas like TRIM and CLEAN, along with robust Pivot Table features to analyze your data accurately without duplicate glitches.
- 1. Open your dataset: Launch WPS Spreadsheet and open the file containing your data.
- 2. Clean the text: Use the =TRIM() or =CLEAN() formulas to standardize your text and remove hidden spaces.
- 3. Insert a Pivot Table: Select your cleaned data, navigate to the 'Insert' tab on the top ribbon, and click 'PivotTable'.
- 4. Analyze without duplicates: Drag and drop your fields to create a precise, duplicate-free summary of your data.

Frequently Asked Questions
Why doesn't the TRIM function remove all spaces?
The TRIM function removes standard spaces (character code 32), but often data exported from websites contains non-breaking spaces (character code 160). You can remove these by using the SUBSTITUTE function combined with TRIM: =TRIM(SUBSTITUTE(A2, CHAR(160), " ")).
Do I need to recreate my Pivot Table after cleaning the source data?
No, you do not need to recreate it. Once you have corrected the source data, simply right-click anywhere inside the Pivot Table and select 'Refresh'. The duplicate items will automatically merge.
Can formatting differences cause duplicate items in a Pivot Table?
No, visual formatting like bold text, italics, or different font colors will not cause duplicates. Pivot Tables only differentiate items based on the actual underlying cell value or text string.




