logo
search
Document Editing Problems

How to Create a Word Mail Merge Grouped by Family Number

Olivia MillerOlivia Miller Oct 1, 2026 868 views

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.

How to Group Mail Merge by 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.
Before you start

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.

Solution 1Recommended

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.

1
Sort your data source

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.

2
Change the mail merge type

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.

3
Link the data source

Click 'Select Recipients' > 'Use an Existing List' in the Mailings tab. Locate and open the sorted spreadsheet you prepared in the first step.

4
Design the layout and insert fields

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.

5
Execute the merge

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.

Use the Directory (or Catalog) Mail Merge Feature
Importance of Sorting: If you forget to sort your data source by the family number beforehand, the directory merge will list the data in its original order, preventing identical family numbers from grouping correctly.
Efficient Mail Merge with WPS Office

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. 1. Open WPS Writer: Launch WPS Writer and create a new blank document. Navigate to the 'References' tab on the top ribbon.
  2. 2. Start Mail Merge: Click on 'Mail Merge' to activate the tools, then click 'Open Data Source' to import your sorted Excel file.
  3. 3. Select Directory format: Click on 'Mail Merge Type' in the ribbon and choose 'Directory' to ensure records list continuously.
  4. 4. Insert fields: Use 'Insert Merge Field' to place your Family Number and Name fields into the document layout.
  5. 5. Generate the document: Click 'Merge to New Document' to generate your final grouped roster.
Fully compatible with Microsoft Word (.docx) and Excel (.xlsx) formatsBuilt-in Directory and Catalog merge types for easy data groupingLightweight application that runs smoothly across macOS and WindowsFree alternative with a familiar, user-friendly interface
microsoft office alternative - wps office

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.