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.
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.
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.
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 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.