How to Use Word Mail Merge for Multiple Recipients and Name Variations
Question details
The user needs to set up conditional formatting in Word Mail Merge to customize greetings based on whether the recipients are a single person, a couple with the same surname, or a couple with different surnames.

- Product
- Microsoft Word / WPS Writer
- Device & OS
- not provided
- Scenario
- Creating a mail merge document, such as wedding invitations or holiday cards, that requires dynamic greeting lines based on recipient data.
- Observed behavior
- Standard Mail Merge fields do not automatically adapt the greeting syntax for couples versus singles, requiring advanced nested IF field rules.
Ensure your data source spreadsheet has distinct, clean columns for the first and second recipient's names, as well as their surnames, so the conditional fields have accurate data to reference.
Use Nested IF Fields for Dynamic Greetings
By toggling field codes, you can write conditional IF statements that check if a second name exists and if surnames match, formatting the greeting accordingly.
The standard Mail Merge Wizard cannot handle complex name variations automatically. You will need to manually insert and edit field codes using IF...THEN...ELSE logic to test multiple conditions simultaneously.
Open your Mail Merge document and press Alt+F9 (or Option+F9 on Mac) to reveal the document's hidden field codes.
Press Ctrl+F9 to insert a new set of field code brackets { }. Inside the brackets, type your IF statement to check if a second recipient exists, such as: IF { MERGEFIELD SpouseName } = "" "Single Greeting" "Couple Greeting".
Replace the "Couple Greeting" section by inserting another IF statement (using Ctrl+F9) to check if the surnames match: IF { MERGEFIELD Surname1 } = { MERGEFIELD Surname2 } "Shared Surname Greeting" "Different Surnames Greeting".
Add the appropriate text strings for each outcome, for example: 'Mr. and Mrs. { MERGEFIELD Surname1 }' for a shared surname, or '{ MERGEFIELD Name1 } and { MERGEFIELD Name2 }' for different surnames.
Press Alt+F9 again to hide the codes. Go to the Mailings tab and click 'Preview Results' to test every recipient type in your list before completing the merge.

Use WPS Writer for Advanced Mail Merge Features
WPS Writer provides robust Mail Merge capabilities that are fully compatible with Microsoft Word documents and Excel data sources, making it easy to create complex conditional greetings for any occasion.
- 1. Open your document: Launch WPS Writer, open your main document, and navigate to the 'Mailings' tab on the top ribbon.
- 2. Link data source: Click 'Open Data Source' and select your Excel recipient list to link the data.
- 3. Build conditional statements: Right-click in the document to toggle field codes and use Ctrl+F9 to build your custom IF statements for name variations.
- 4. Preview and merge: Click 'View Merged Data' to preview your customized greetings, then select 'Merge to New Document' to generate your final files.

Frequently Asked Questions
Why aren't my IF fields updating correctly when I preview the merge?
Sometimes Word requires a manual refresh to evaluate nested field codes. Try pressing Ctrl+A to select the entire document, then press F9 to update all fields before previewing the merge again.
Can I use the Mail Merge rule wizard instead of pressing Alt+F9?
The 'Rules' > 'If...Then...Else' dialog box is great for simple conditions, but for checking multiple variables (like checking if a second name exists AND if surnames match), you must nest the IF fields manually by revealing codes with Alt+F9.
How do I type the curly brackets for field codes?
You must press Ctrl+F9 (or Cmd+F9 on Mac) to insert special field code brackets. Typing standard curly brackets {} on your keyboard will just insert regular text, and the merge rule will be ignored.
What happens if there are blank spaces in my Excel data source?
Blank spaces in your spreadsheet cells can cause the IF condition for 'empty' ("") to fail, as Word reads the space as a valid character. Ensure your empty cells in Excel are completely cleared of spaces.




