Document Editing Problems

How to Remove Duplicate Names from Word Mail Merge Data

Maira MehtabMaira Mehtab Oct 29, 2026 869 views

Question details

The user needs to ensure each counsel name appears only once in the final merged document and wants to ignore blank fields in the source data.

How to Remove Duplicate Names from Word Mail Merge Data
Product
Word
Device & OS
not provided
Scenario
Performing a mail merge with data imported from an external application where multiple parties might be represented by the same counsel, creating duplicate entries.
Observed behavior
Word's MERGEFIELD outputs exactly what is in the data source without automatically deduplicating values or skipping blank entries.
Before you start

Save a backup copy of your original data source file (such as your Excel spreadsheet or CSV) before applying any deduplication steps.

Solution 1Recommended

Preprocess and Deduplicate Data in Excel

Since Word cannot automatically deduplicate MERGEFIELD values, the most reliable method is to consolidate your data in Excel before running the mail merge.

Word mail merge is designed to pull records exactly as they appear in the connected database. To prevent duplicate names from appearing, you must clean the data source directly. Using Excel or Power Query allows you to quickly remove duplicates and filter out empty fields.

1
Open your data source

Launch Microsoft Excel and open the spreadsheet or exported data file containing the counsel names.

2
Select the relevant data range

Highlight the column containing the counsel names, or select the entire data table if you want to keep entire records intact.

3
Remove duplicate entries

Navigate to the 'Data' tab on the ribbon and click on 'Remove Duplicates'. Select the column for counsel names to ensure only unique names are kept.

4
Filter out blank fields

Apply a filter to the counsel column, uncheck the 'Blanks' option to hide empty entries, and copy the cleaned data to a new sheet.

5
Run the Mail Merge

Save this cleaned spreadsheet, open your Word document, and connect this new file as your Mail Merge recipient list.

Preprocess and Deduplicate Data in Excel
Data Consolidation Tip: If you need to keep multiple parties under a single counsel, use Excel's Power Query 'Group By' feature or functions like TEXTJOIN to combine related row data into a single cell before merging.

Easily Manage Mail Merge and Data Deduplication with WPS Office

WPS Office provides a highly compatible and intuitive suite for managing complex mail merge tasks. You can seamlessly clean up your data in WPS Spreadsheet and execute a flawless mail merge in WPS Writer without advanced coding.

  1. 1. Open your data in WPS Spreadsheet: Launch WPS Spreadsheet and import your raw data containing the duplicate counsel names.
  2. 2. Remove duplicates instantly: Go to the 'Data' tab, click 'Remove Duplicates', and select the specific column to automatically clean your list.
  3. 3. Start WPS Writer Mail Merge: Open your document in WPS Writer, navigate to the 'References' tab, and click 'Mail Merge' to activate the tools.
  4. 4. Connect the cleaned data: Click 'Open Data Source', select your newly saved WPS Spreadsheet file, and insert your fields to finish the document.
100% compatible with Microsoft Word (.docx) and Excel (.xlsx) formats.One-click 'Remove Duplicates' tool built directly into WPS Spreadsheet.Intuitive Mail Merge wizard in WPS Writer for easy document automation.Free to download, lightweight, and works seamlessly across operating systems.
microsoft office alternative - wps office

Frequently Asked Questions

Can Word automatically remove duplicate MERGEFIELD values?

No, Word's mail merge feature does not have a built-in function to automatically remove duplicate values. It pulls data exactly as it appears in the connected source file. You must preprocess the data in Excel, Access, or use complex conditional IF field codes.

How do I skip blank fields in a Word mail merge?

You can use the 'Skip Record If' rule located under the 'Rules' dropdown in the Mail Merge ribbon tab. Set the rule to skip the record if the specific counsel field is equal to blank. Alternatively, clean the blanks out of your source spreadsheet before merging.

What is the keyboard shortcut to view MERGEFIELD codes in Word?

You can press Alt + F9 on Windows (or Option + F9 on Mac) to toggle between viewing the underlying field codes (like { MERGEFIELD CounselName }) and their actual merged results in the document.