Conditional Formatting

How to apply a different format to my merge fields based on certain conditions?

This article describes how to use conditional formatting in a mail merge when you want to apply formatting to data values based on rules that you specify.

Step 1: Create new column for every conditional format

In Google Sheets, create a new column for every conditional format required

In the example below, we want to use conditional formatting in our mail merge to display the city name San Francisco or Las Vegas in blue text and the city name Chicago in red text. So we have created two additional columns called City-Blue and City-Red.

Step 2: Type conditional logic formula for first column 

Type the conditional logic formula in the first cell of the first column to be conditionally formatted.

In this example, the formula states that if the city in C2 is San Francisco or Las Vegas, then show the city in D2, otherwise leave D2 blank.

Step 3: Type conditional logic formula for second column 

Type the conditional logic formula in the first cell of the second column to be conditionally formatted.

In this example, the formula states that if the city in C2 is Chicago,  then show the city in E2, otherwise leave E2 blank.

Step 4: Apply conditional logic formula in each column 

Apply the conditional logic formula to the rest of the cells in each column, by dragging the first cell downward from the bottom-right corner.

Repeat Steps 3 and 4 for every column where conditional formatting is to be applied.

In this example, we only have two columns where conditional formatting is going to be applied.

Step 5: Insert conditional *|merge fields|*

In your merge template, insert the conditional *|merge fields|* as you would for any other merge field.

In this example, we inserted *|City-Blue|* and *|City-Red|* next to each other with a space between each *|merge field|*.

Step 6: Format conditional *|merge fields|*

Format each of the conditional *|merge fields|* by highlighting the text (including the *| and |* tags) and changing the color or any other formatting option as required. 

In this example, we formatted *|City-Blue|* with blue text and *|City-Red|* with red text.