Document Editing Problems

Group Mail Merge Records by Order Number in Microsoft Word

Camila MilosovichCamila Milosovich Nov 22, 2026 868 views

Question details

Create a mail merge that groups multiple order-item records under the same order number.

Group Mail Merge Records by Order Number in Microsoft Word
Product
Microsoft Word Mail Merge
Device & OS
not provided
Scenario
An Excel worksheet or other data source contains separate rows for items belonging to the same order.
Observed behavior
The desired result is one invoice or document section per order, containing all items with that order number.
Before you start

Check that the data source has unique field names, including Order_Number, and that an Excel worksheet has headers in its first row. Sort the records by Order_Number so items for the same order appear together.

Solution 1Recommended

Use a many-to-one mail merge add-in

Use an add-in designed to combine multiple source rows into one document per order.

1
Choose an add-in

Find a many-to-one mail merge add-in compatible with your version of Word, then install it following the provider's instructions.

2
Connect the source

In Word, open the add-in and select your Excel worksheet or other supported data source. Check that Order_Number and the item fields are available.

3
Set the grouping field

In the add-in's merge setup, select Order_Number as the grouping field and add the item fields to the repeating section or table.

4
Run a test merge

Use the add-in's preview or merge command to create a test document. Check that all items for each order appear together and that a new order starts in the intended document or section.

Use a many-to-one mail merge add-in
Add-in controls vary: Grouping and output options depend on the add-in. Word's standard Next Record rule advances rows but does not, by itself, group all rows with the same order number.
Free Microsoft Office alternative

Edit order documents and worksheets with WPS Office

WPS Office is a free, lightweight alternative for working with order documents and spreadsheets. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files, though it does not fix Word's many-to-one merge setup.

Edit invoice templates and organize order data in one office suiteOpen and edit Microsoft Word DOCX and Excel XLSX filesUse a familiar interface for a smoother transition from Microsoft OfficeWork with a free, lightweight office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Does Word's Next Record rule group items by order number?

No. The Next Record rule advances to another data row; it does not automatically collect all rows with the same Order_Number into one invoice. Use a many-to-one add-in or restructure the source to have one row per order.

Can I use a Directory merge for multiple order items?

Yes. In Word, choose Mailings > Start Mail Merge > Directory to create a continuous list of records. Creating separate grouped sections when Order_Number changes requires additional conditional field logic or another grouping method.

How should I prepare an Excel source for mail merge?

Put unique field names in the first row, including Order_Number and the item fields. Sort by Order_Number before using a grouping method, and select the worksheet through Mailings > Select Recipients in Word.

How can I check that each invoice contains the right items?

Run a test merge and inspect orders with one item and several items. Confirm that each order number has all its items and that no items appear under a different order.