Conditional Formatting Example

In this example, we will set up conditional formats to reflect "traffic lighting" on an Actual vs. Plan Variance % column, which will display either a green, yellow or red cell background color depending on the percent value:

  • Cells with values greater than 0% will be highlighted green.

  • Cells with values less than 0% and greater than -10% will be highlighted yellow.

  • Cells with values less than or equal to -10% will be highlighted red.

The original grid is displayed in Figure 4-33.

Figure 4-33 Traffic Lighting Example, Original Grid


screenshot shows grid with variance column with numbers ranging from -248.9 to 229.9.

In the grid editor, select the variance % cell, and then click conditional properties to create the conditional formats. For details about creating conditions, see Creating a Condition.
screenshot shows the Actual vs Plan variance column highlighted in a grid

For the Green condition, create a conditional format where the Current Cell Value is greater than 0:
screenshot shows formula Current Cell Value > Value 0

For the Yellow condition, create a conditional format with two expressions:

  • Current Cell Value is less than 0, AND

  • Current Cell Value is greater than -10


screenshot shows formula with current cell value < value 0 and current cell value > value -10

For the Red condition, create a conditional format where the Current Cell Value is less than -10:
screenshot shows formula with current cell value < value -10.

Figure 4-34 shows the final grid with all three conditions applied to the Variance % column.

Figure 4-34 Grid with Traffic Lighting Conditions Applied

screenshot shows variance column with values above zero highlighted in green, values between zero and -10 in yellow, and values below -10 in red.