2.4.43 CF12

The CF12 record specifies a conditional formatting rule.

All CF12 records MUST follow a CondFmt12 record, another CF12 record, or a CFEx record.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

frtRefHeader

...

...

ct

cp

cce1

cce2

dxf (variable)

...

rgce1 (variable)

...

rgce2 (variable)

...

fmlaActive (variable)

...

A

B

C

D

E

ipriority

icfTemplate

...

cbTemplateParm

rgbTemplateParms (16 bytes)

...

...

...

rgbCT (variable)

...

frtRefHeader (12 bytes): An FrtRefHeader. The frtRefHeader.rt field MUST be 0x087A. The frtRefHeader.grbitFrt.fFrtRef field MUST be zero. All of the fields of the frtRefHeader.ref8 structure MUST be zero and MUST be ignored.

ct (1 byte): An unsigned integer that specifies the type of condition. This field determines the type of the rgbCT field as specified in the following table. MUST be a value from the following table:

Value

Meaning

0x01

Apply the conditional formatting if the comparison operation specified by cp evaluates to TRUE

rgbCT MUST be omitted.

0x02

Apply the conditional formatting if the formula (section 2.2.2) specified by rgce1 evaluates to TRUE.

rgbCT MUST be omitted.

0x03

Use color scale formatting.

rgbCT is a CFGradient.

0x04

Use data bar formatting.

rgbCT is a CFDatabar.

0x05

Apply the conditional formatting when the cell value passes a filter specified in the rgbCT structure.

rgbCT is a CFFilter.

0x06

Use icon set formatting

rgbCT is a CFMultistate.

cp (1 byte): An unsigned integer that specifies the comparison function used when ct is equal to 0x01. In the following table, v represents the cell value, and v1 and v2 represent the results of evaluating rgce1 and rgce2. The value of this field MUST be a value from the following table:

Value

Apply the conditional formatting if

0x01

v2 is greater than or equal to v1, and v is greater than or equal to v1 and less than or equal to v2

–Or–

v1 is greater than v2, and v is greater than or equal to v2 and less than or equal to v1

0x02

v2 is greater than or equal to v1, and v is less than v1 or greater than v2

–Or–

v1 is greater than v2, and v is less than v2 or greater than v1

0x03

v is equal to v1

0x04

v is not equal to v1

0x05

v is greater than v1

0x06

v is less than v1

0x07

v is greater than or equal to v1

0x08

v is less than or equal to v1

cce1 (2 bytes): An unsigned integer that specifies the size of rgce1 in bytes. MUST be zero unless ct is equal to 0x01 or 0x02. MUST be less than or equal to 16409.

cce2 (2 bytes): An unsigned integer that specifies the size of rgce2 in bytes. MUST be zero unless ct is equal to 0x01 and cp is equal to 0x01 or 0x02. MUST be less than or equal to 16409.

dxf (variable): A DXFN12 that specifies the formatting to apply to a cell that fulfills the condition. If ct is equal to 0x03, 0x04 or 0x06, then dxf.cbDxf MUST be equal to 0x00000000.

rgce1 (variable): A CFParsedFormulaNoCCE that specifies the formula used to evaluate the first operand in a comparison when ct is 0x01. If ct is 0x02 rgce1 MUST be a Boolean function.

rgce2 (variable): A CFParsedFormulaNoCCE that specifies the formula used to evaluate the second operand of the comparison when ct is 0x01 and cp is either 0x01 or 0x02.

fmlaActive (variable): A CFParsedFormula that specifies the formula that specifies an activity condition for the color scale, data bar and icon set formatting rule types. If ct is equal to 0x03, 0x04 or 0x06, then the conditional formatting is applied if fmlaActive evaluates to TRUE.

A - unused1 (1 bit): Undefined and MUST be ignored.

B - fStopIfTrue (1 bit): A bit that specifies whether, when a cell fulfills the condition corresponding to this rule, the lower priority conditional formatting rules that apply to this cell are evaluated. MUST be one of the following values:

Value

Meaning

0x0

Evaluate lower priority conditional formatting rules that apply to this cell

0x1

If the cell fulfills the condition corresponding to this rule, do not evaluate lower priority conditional formatting rules that apply to this cell

MUST be zero when ct is equal to 0x03, 0x04 or 0x06.

C - reserved1 (2 bits): MUST be zero and MUST be ignored.

D - unused2 (1 bit): Undefined and MUST be ignored.

E - reserved2 (3 bits): MUST be zero and MUST be ignored.

ipriority (2 bytes): An unsigned integer that specifies the priority of the rule. Rules that apply to the same cell are evaluated in increasing order of ipriority. MUST be unique across all CF12 records and CFExNonCF12 structures in the worksheet substream.

icfTemplate (2 bytes): An unsigned integer that specifies the template from which the rule was created. MUST be a value from the following table:

Value

Meaning

0x0000

Cell value

0x0001

Formula

0x0002

Color scale formatting

0x0003

Data bar formatting

0x0004

Icon set formatting

0x0005

Filter

0x0007

Unique values

0x0008

Contains text

0x0009

Contains blanks

0x000A

Contains no blanks

0x000B

Contains errors

0x000C

Contains no errors

0x000F

Today

0x0010

Tomorrow

0x0011

Yesterday

0x0012

Last 7 days

0x0013

Last month

0x0014

Next month

0x0015

This week

0x0016

Next week

0x0017

Last week

0x0018

This month

0x0019

Above average

0x001A

Below Average

0x001B

Duplicate values

0x001D

Above or equal to average

0x001E

Below or equal to average

cbTemplateParm (1 byte): An unsigned integer that specifies the size of the rgbTemplateParms field in bytes. MUST be 16.

rgbTemplateParms (16 bytes): A CFExTemplateParams that specifies the parameters for the rule.

rgbCT (variable): A field that specifies the parameters of this rule. The type of rgbCT depends on the value of ct.