Create Conditional Tables in Microsoft Word Mail Merge
Question details
Create a mail-merge table with fixed columns and conditional rows, optionally including images associated with row text.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A mail-merge document needs a table whose number of rows depends on merge-field values.
- Observed behavior
- The desired output is a table with the appropriate rows and related images for each merged result.
Check whether the conditional rows belong to one data-source record or whether each row comes from a separate record. Prepare sample records covering the different combinations of rows and any image paths you intend to use.
Use IF fields to select a complete table for each record
Use this approach when all conditional rows belong to the same merge record.
Create a complete table variant for each relevant combination of conditions, keeping the columns consistent. Nested IF fields can select the appropriate variant; this can become difficult to maintain when there are many combinations.
A macro is not required for this approach. Test complex table and image fields with representative records before running the full merge.
In Word, open the merge document and choose Mailings > Select Recipients to connect the source containing the condition fields.
Use Insert > Table to create the required versions of the table, including only the rows appropriate to each condition combination. Use Mailings > Insert Merge Field to add the related text fields.
On the Mailings tab, use Rules > If...Then...Else to compare a merge field with the value that controls a table variant. For multiple conditions, use nested IF fields so each final result contains the complete matching table rather than an isolated row.
Where a table variant needs an image, use Insert > Pictures to add it or a linked picture. Use Mailings > Preview Results to check several records, then choose Finish & Merge > Edit Individual Documents and verify that the tables and images appear as intended.

Use a Directory merge for rows from separate records
Use a Directory or Catalog merge when each desired table row comes from a different data-source record.
Edit Mail-Merge Documents with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility, making it easier to move and edit existing documents. It does not fix Microsoft Word's conditional merge behavior.

Frequently Asked Questions
Do I need a macro to create conditional tables in Word?
Not necessarily. If all the conditions come from one merge record, nested IF fields can select among complete table variants. Use Mailings > Rules > If...Then...Else to start setting up the conditions.
When should I use a Directory merge instead?
Use Mailings > Start Mail Merge > Directory when each desired row comes from a separate data-source record. Check the merged output because the document layout can produce separate one-row tables.
Can conditional table rows include images?
Yes. Add pictures to the relevant table variants through Insert > Pictures. If images are linked or their paths vary by record, test the completed merge and update image fields if needed.
How can I check the table before merging all records?
Use Mailings > Preview Results to inspect representative records, then select Finish & Merge > Edit Individual Documents to verify the final tables and images.




