Group Mail Merge Records by Order Number in Microsoft Word
Question details
Create a mail merge that groups multiple order-item records under the same order number.

- 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.
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.
Use a many-to-one mail merge add-in
Use an add-in designed to combine multiple source rows into one document per order.
Find a many-to-one mail merge add-in compatible with your version of Word, then install it following the provider's instructions.
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.
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.
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.

Prepare one worksheet row per order for a standard merge
Use a regular Word letter merge when you can arrange each order's items in a fixed set of columns.
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.

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.




