Conditional Merge Fields
How to create conditional merge fields in Google Sheets whose content is formatted based on other merge fields for a mail merge?
This article describes how to create merge fields in Google Sheets whose content is conditionally formatted based on other merge fields for a mail merge.
Step 1: Create column for conditional *|merge field|*
In Google Sheets, create a column for the required conditional merge field.
In this example, a column called Title has been created to determine the title used for each person depending on their gender.
Step 2: Type conditional logic formulaÂ
Type the conditional logic formula in the first cell of the column to be conditionally formatted.
In this example, the logic formula states that if the gender in cell C2 is M, then Mr is shown in the G2 cell, otherwise Ms is shown in the G2 cell.
Step 3: Apply conditional logic formula
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.
Step 4: Insert conditional *|merge fields|*
In the merge template for the mail merge, insert the conditional *|merge fields|* as you would for any other merge field.
In this example, *|Title|* and *|Name|* have been inserted beside each other with a space in between.