Skip to content

excel cfextended

goworm edited this page Jun 26, 2026 · 1 revision

Excel: Extended Conditional Formatting

Catch-all conditional-formatting dispatch for CF sub-types that are not exposed by their own --type alias, selected with --prop type=<subtype>.

Path: /{SheetName}/cf[N]

Operations

  • add - Create an extended CF rule, selecting the sub-type via --prop type=<subtype>
  • get - Read back a CF rule's canonical type and style reference

add

Parent: /{SheetName}

Property Required/Default Description
type required Sub-type selector. One of: belowAverage, containsBlanks, notContainsBlanks, containsErrors, notContainsErrors, contains, notContains, beginsWith, endsWith
ref Target cell range (aliases: sqref, range), e.g. A1:A100
text Substring for the contains / notContains / beginsWith / endsWith sub-types
fill Background fill color (hex RGB) applied via dxf
font.color Font color (hex RGB) applied via dxf
font.bold Bold font via dxf (true / false)
stopIfTrue Stop evaluating subsequent CF rules when this rule applies (true / false)

get Attributes

Attribute Type Description
type string Canonical CF rule type token (e.g. dataBar, colorScale, iconSet, formula, topN, cellIs, containsText, aboveAverage, duplicateValues, uniqueValues, timePeriod). Emitted on every CF rule.
ref string Target cell range
text string Matched substring (when the sub-type emits it)
dxfId number Differential format id referencing dxf styles. Emitted only when present on the rule.

Examples

# Highlight blank cells in a range
officecli add data.xlsx /Sheet1 --type cfextended \
  --prop type=containsBlanks \
  --prop ref=A1:A100 \
  --prop fill=FFCCCC

# Highlight cells whose text contains "error" in red bold
officecli add data.xlsx /Sheet1 --type cfextended \
  --prop type=contains \
  --prop text=error \
  --prop ref=B1:B50 \
  --prop font.color=FF0000 \
  --prop font.bold=true

# Cells beginning with a substring, stopping further rules
officecli add data.xlsx /Sheet1 --type cfextended \
  --prop type=beginsWith \
  --prop text=PRE \
  --prop ref=C1:C100 \
  --prop stopIfTrue=true

# Below-average cells
officecli add data.xlsx /Sheet1 --type cfextended \
  --prop type=belowAverage \
  --prop ref=D1:D100 \
  --prop fill=FFCCCC

# Read back a CF rule's canonical type and style id
officecli get data.xlsx /Sheet1/cf[1]

Notes

  • Use cfextended only for sub-types without a dedicated --type alias: belowAverage, containsBlanks, notContainsBlanks, containsErrors, notContainsErrors, contains, notContains, beginsWith, endsWith.
  • The type property is required on add and selects which sub-type rule is created.
  • The text property applies to the contains, notContains, beginsWith, and endsWith sub-types.
  • fill, font.color, and font.bold style the matched cells through a differential format (dxf).
  • On get, the type attribute reports the normalized canonical CF type token, and dxfId is emitted only when the rule references a dxf style.

See Also


Based on OfficeCLI v1.0.119

Clone this wiki locally