Group Roommates by Room in Word Mail Merge
Question details
Create a Word page or document for each room that lists all students assigned to it.

- Product
- Microsoft Word Mail Merge
- Device & OS
- not provided
- Scenario
- Student records contain room assignments, and roommates need to appear together in the merged output.
- Observed behavior
- The desired output groups students by a shared room number rather than treating individual bed assignments as separate rooms.
Prepare a recipient list with one row per student and separate columns for the student name and shared room number. If assignments are labeled 201A, 201B, and 201C, add a room column containing 201 for each student.
Use Word Directory Mail Merge and separate room groups
Use this method to produce a continuous list sorted by room, then add page breaks between rooms.
A Directory merge repeats the record layout for each student in one document. Sorting puts roommates next to one another, but Word does not automatically insert a page break when the room number changes.
In Word, open a new document and choose Mailings > Start Mail Merge > Directory. In some versions, the option may be called Catalog.
Choose Mailings > Select Recipients > Use an Existing List and select your student data file. Open Edit Recipient List and sort by the shared room-number column.
In the document, use Mailings > Insert Merge Field to add the room number and student name fields. Arrange them in a compact line or row that Word can repeat for each student.
Choose Mailings > Finish & Merge > Edit Individual Documents, then merge all records into a new document.
In the merged document, place the cursor before the first student in each new room and choose Insert > Page Break. Save the combined document, or copy each room's section into a separate document and save it.

Use a many-to-one mail merge add-in
Consider an add-in when you need to automate grouping and create many separate room documents.
Prepare room lists with WPS Office
WPS Office is a free, lightweight alternative for editing student lists and room documents. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files into WPS; it does not fix Word's mail merge grouping behavior.

Frequently Asked Questions
Can Word automatically put each room on a separate page with a Directory merge?
A basic Directory merge creates a continuous document and does not automatically add a page break when the room number changes. Sort by room, then insert page breaks in the merged document, or use an add-in that supports grouping.
How should I group assignments such as 201A and 201B?
Add a separate room-number column to the recipient list and enter 201 for both students. Sort or group using that column rather than the individual assignment values.
How do I create a separate file for each room?
After choosing Mailings > Finish & Merge > Edit Individual Documents, copy each room's section into a new Word document and save it. For a large number of rooms, consider a many-to-one add-in that supports separate output files.
Why does a room list continue onto a second page?
A page break controls where the room starts, not how much content fits on the page. Reduce spacing or font size in the merged document if the room's list needs to fit on one page.




