Skip to content

excel uniquevalues

goworm edited this page Jun 26, 2026 · 1 revision

Excel: Unique Values

A conditional-formatting rule that highlights the unique values in a cell range.

Path: /{SheetName}/cf[N]

Operations

  • add - Create a unique-values rule over a range, with optional dxf styling
  • get - Read back the rule's canonical type and dxf reference

add

Parent: /{SheetName}

Properties

Property Required/Default Description
ref required Target cell range. Aliases: sqref, range.
fill Background fill via dxf (color).
font.color Font color via dxf (color).
font.bold Bold via dxf (bool).
stopIfTrue Stop evaluating subsequent CF rules when this rule applies (bool).

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. Aliases: sqref, range.
dxfId number Differential format id referencing dxf styles. Emitted only when present on the rule.

Examples

# Highlight unique values in A1:A100 with a yellow fill
officecli add data.xlsx /Sheet1 --type uniquevalues \
  --prop sqref=A1:A100 --prop fill=FFFF00

# Unique values with red bold font and no fill
officecli add data.xlsx /Sheet1 --type uniquevalues \
  --prop ref=A1:A100 \
  --prop font.color=FF0000 \
  --prop font.bold=true

# Stop evaluating later CF rules when this one matches
officecli add data.xlsx /Sheet1 --type uniquevalues \
  --prop range=B2:B50 --prop fill=FFFF00 \
  --prop stopIfTrue=true

# Read back a rule
officecli get data.xlsx /Sheet1/cf[1]

Notes

  • The rule highlights cells whose values appear only once within the target range.
  • ref accepts the aliases sqref and range; all three name the same target range.
  • fill, font.color, and font.bold are applied through a differential format (dxf); the resulting dxfId is readable via get when present.
  • type and dxfId are read-only and surface only through get.

See Also


Based on OfficeCLI v1.0.119

Clone this wiki locally