Conditional Merge Fields
How do I create merge fields that are conditional upon the content of other fields?
This article describes how to create conditional merge fields when the content of a new merge field is automatically determined by filtering an existing merge field.
In Google Sheets, create a new column for the conditional format you need.
In the example below, we want to use conditional formatting in our mail merge to determine the title to be used for each person, depending on their gender. We have therefore created an additional column called Title.
Write the conditional logic formula in the first cell of the column to be conditionally formatted.
In this example, the formula states that if the gender in C2 is M, then show Mr in G2, otherwise show Ms in G2.
Apply the conditional logic formula to the rest of the cells in the column, by dragging the first cell downward from the bottom-right corner.
In your merge template, insert the conditional *|merge field|* into your merge template as you would for any other merge field.
In this example, we inserted *|Title|* and *|Name|* next to each other with a space between each *|merge field|*.