How to Show Mail Merge Values for Selected Records in Word
Question details
The user needs to conditionally display specific mail merge values based on specific record descriptions, particularly when dealing with one-to-many data structures where standard SKIPIF or NEXT commands fail inside Table blocks.

- Product
- Word
- Device & OS
- not provided
- Scenario
- Setting up a complex mail merge document that requires conditional logic to display values only when the record description equals specific criteria.
- Observed behavior
- Standard mail merge fields like SKIPIF, NEXTIF, and NEXT do not provide a straightforward way to skip records inside a TableStart and TableEnd block for one-to-many data structures.
Ensure your data source (such as an Excel spreadsheet) is accurately categorized and filtered before initiating the mail merge, as preparing your data in advance simplifies conditional merging.
Use IF Fields for Conditional Mail Merge Display
Apply standard Word IF fields to display values only when specific text conditions are met.
Standard SKIPIF fields are often problematic for skipping records within complex structures and must be placed at the very beginning of the document. Instead, using multiple IF fields is the most reliable way to display specific contents conditionally.
Press Ctrl + F9 on your keyboard to insert a pair of empty field braces { } into your Word document.
Inside the braces, type your first IF statement to check for condition A: IF { MERGEFIELD Description } = "A" "{ MERGEFIELD Value }" "".
Immediately after the first statement, press Ctrl + F9 again and type the condition for B: IF { MERGEFIELD Description } = "B" "{ MERGEFIELD Value }" "".
Right-click the fields and select 'Update Field', then click 'Preview Results' on the Mailings tab to verify that the values display conditionally.

Pre-process One-to-Many Data in Excel
Since standard mail merge has limited support for repeating related records, pre-filtering data in your spreadsheet is often the most effective workaround.
Handle Mail Merge Conditionally with WPS Writer
WPS Writer offers a comprehensive Mail Merge feature that fully supports complex field codes like IF, NEXT, and SKIPIF, allowing you to seamlessly connect to Excel data sources and build conditional documents.
- 1. Open Mail Merge Tab: Launch WPS Writer, open your document, and navigate to the 'References' or 'Mailings' tab on the top ribbon.
- 2. Connect Data Source: Click 'Open Data Source' to link your prepared Excel spreadsheet containing your conditional records.
- 3. Insert Merge Fields: Use the 'Insert Merge Field' button to place your standard fields, or press Ctrl+F9 to type out manual IF field codes.
- 4. Preview and Merge: Click 'View Merged Data' to preview your conditional logic, then select 'Merge to New Document' to generate the final file.

Frequently Asked Questions
What does the SKIPIF field do in a mail merge?
The SKIPIF field instructs the application to skip the current data record and move to the next one if a specific condition is met. However, if used, it typically must be the first field in the mail merge main document to function correctly.
Can I use multiple conditions in a single IF field?
Standard mail merge IF fields are relatively simple and do not natively support complex 'OR' operators gracefully. The standard workaround is to place multiple separate IF fields sequentially, such as one for condition A and another immediately following it for condition B.
Why doesn't mail merge work well with one-to-many relationships?
Standard mail merge is designed for flat data, meaning one data record per document or page. To handle one-to-many structures (like generating an invoice with multiple varying line items), you generally need third-party add-ins or must pre-process the relationships into flat columns in Excel.




