How to Create a Word Mail Merge Grouped by Family Number
Question details
The user wants to set up a mail merge that groups multiple names under a single family number, repeating this layout continuously for each subsequent family number.

- Product
- Word Processor
- Device & OS
- macOS
- Scenario
- Creating a roster, catalog, or grouped list where multiple individuals share a common identifier (family number) without starting a new page for each person.
- Observed behavior
- A standard letter merge places each name on a separate page. The user needs a directory-style layout where all members of a family are listed together under their respective family number.
Ensure your data source (such as an Excel spreadsheet) is sorted by the 'Family Number' column so that all members of the same family are grouped together sequentially before starting the merge.
Use the Directory (or Catalog) Mail Merge Feature
Switching from a standard 'Letters' merge to a 'Directory' merge allows you to list multiple records continuously on the same page, grouping them effectively by your chosen category.
A standard letter mail merge is designed to generate a new document or a new page for every single row of data in your spreadsheet. By utilizing a Directory merge, the word processor will place multiple items immediately after one another. When combined with properly sorted data, this groups all family members under their respective family number.
Open your Excel spreadsheet or database containing the names and family numbers. Select your data, click 'Data' > 'Sort', and sort the spreadsheet by the 'Family Number' column. Save and close the file.
Open a new blank document in your word processor. Navigate to the 'Mailings' tab, click 'Start Mail Merge', and select 'Directory' (sometimes labeled as 'Catalog') from the dropdown menu.
Click 'Select Recipients' > 'Use an Existing List' in the Mailings tab. Locate and open the sorted spreadsheet you prepared in the first step.
Click 'Insert Merge Field' to add the Family Number, press Enter, and then insert the Name fields. Format the spacing and layout to represent exactly how one single family block should appear.
Click 'Finish & Merge' and select 'Edit Individual Documents' (or 'Merge to New Document'). Click 'OK' to merge all records. The resulting document will display families grouped together sequentially.

Create Grouped Mail Merges Seamlessly in WPS Writer
WPS Writer offers a highly intuitive Mail Merge wizard that makes linking data sources and generating grouped directories fast and easy. You can build catalogs, address lists, and family rosters without complex workarounds.
- 1. Open WPS Writer: Launch WPS Writer and create a new blank document. Navigate to the 'References' tab on the top ribbon.
- 2. Start Mail Merge: Click on 'Mail Merge' to activate the tools, then click 'Open Data Source' to import your sorted Excel file.
- 3. Select Directory format: Click on 'Mail Merge Type' in the ribbon and choose 'Directory' to ensure records list continuously.
- 4. Insert fields: Use 'Insert Merge Field' to place your Family Number and Name fields into the document layout.
- 5. Generate the document: Click 'Merge to New Document' to generate your final grouped roster.

Frequently Asked Questions
Why is my mail merge creating a new page for every family member?
You are likely using the 'Letters' document type, which automatically inserts a page break after every record. To fix this, change your mail merge type to 'Directory' or 'Catalog' to list multiple records continuously on the same page.
Do I need to write special code to group by family number?
Not necessarily. If your only goal is to list names consecutively, simply sorting your data source by the family number and using a Directory merge is enough. Advanced grouping (like hiding the family number for duplicate rows) requires specific IF field codes.
Can I add page breaks between different family numbers in a directory merge?
Yes, but it requires inserting an IF field code in your document that evaluates whether the current family number matches the previous one. If they do not match, the code instructs the word processor to insert a page break before printing the new number.




