Contains the conditions and the formatting elements that are applied to the specified range when the conditions are true.
Contained In
Subelements
Remarks
The Range subelement is required. One to three Condition subelements must be included in a ConditionalFormatting element.
This example defines two conditions. First, if the value in cell A29 is not blank, then format the range B29:H33 with a 0.5 point outline border, solid shading, pop-up text enabled, and a silver background. Second, if the value in A29 is blank, then format the range B29:H33 with no border and the default background.
<x:ConditionalFormatting>
<x:Range>B29:H33</x:Range>
<x:Condition>
<x:Value1>$A$29<>""</x:Value1>
<x:Format Style='border:.5pt solid windowtext;background:silver'/>
</x:Condition>
<x:Condition>
<x:Value1>$A$29=""</x:Value1>
<x:Format Style='border:none;mso-background-source:auto'/>
</x:Condition>
</x:ConditionalFormatting>
This example defines two conditions. First, if the value of a cell in the range B29:H33 is not equal to the value in cell A29 plus 12, then format the cell with a 0.5 point outline border, solid shading, pop-up text enabled, and a silver background. Second, if the value in A29 is blank, then format the range B29:H33 with no border and the default background.
<x:ConditionalFormatting>
<x:Range>B29:H33</x:Range>
<x:Condition>
<x:Qualifier>NotEqual</x:Qualifier>
<x:Value1>=$A$29+12</x:Value1>
<x:Format Style='border:.5pt solid windowtext;background:silver'/>
</x:Condition>
<x:Condition>
<x:Value1>$A$29=""</x:Value1>
<x:Format Style='border:none;mso-background-source:auto'/>
</x:Condition>
</x:ConditionalFormatting>
In this example, if the value of a cell in the range B29:H33 is between 5 and 15, then format the cell with a 0.5 point outline border, solid shading, pop-up text enabled, and a silver background.
<x:ConditionalFormatting>
<x:Range>B29:H33</x:Range>
<x:Condition>
<x:Qualifier>Between</x:Qualifier>
<x:Value1>5</x:Value1>
<x:Value2>15</x:Value2>
<x:Format Style='border:.5pt solid windowtext;background:silver'/>
</x:Condition>
</x:ConditionalFormatting>