-
Notifications
You must be signed in to change notification settings - Fork 542
excel conditionalformatting add
zmworm edited this page Apr 16, 2026
·
52 revisions
Add conditional formatting rules for dynamic cell styling.
Path: /{SheetName}
| Property | Default | Description |
|---|---|---|
sqref |
(required) | Target range (e.g., B2:B100) |
type |
(required) | databar |
color |
638EC6 |
Bar fill color (hex RGB) |
min |
0 |
Minimum bound value |
max |
1 |
Maximum bound value |
officecli add data.xlsx /Sheet1 --type cf \
--prop sqref=B2:B100 \
--prop type=databar \
--prop color=63C384| Property | Default | Description |
|---|---|---|
sqref |
(required) | Target range |
type |
(required) | colorscale |
minColor |
F8696B |
Color for minimum value (hex RGB) |
midColor |
Color for midpoint (hex RGB, omit for 2-color scale) | |
maxColor |
63BE7B |
Color for maximum value (hex RGB) |
officecli add data.xlsx /Sheet1 --type cf \
--prop sqref=C2:C100 \
--prop type=colorscale \
--prop minColor=FF0000 \
--prop midColor=FFFF00 \
--prop maxColor=00FF00
officecli add data.xlsx /Sheet1 --type cf \
--prop sqref=D2:D50 \
--prop type=colorscale \
--prop minColor=FFFFFF \
--prop maxColor=0000FF| Property | Default | Description |
|---|---|---|
sqref |
(required) | Target range |
type |
(required) | iconset |
iconSet |
3TrafficLights1 |
Icon set name (see below) |
reverse |
false |
Reverse icon order |
showValue |
true |
Show cell value alongside icon |
Icon sets: 3Arrows1, 3ArrowsGray1, 3Flags1, 3TrafficLights1, 3TrafficLights2, 3Signs1, 3Symbols1, 3Symbols2, 3Stars1, 3Triangles1, 4Arrows1, 4ArrowsGray1, 4RedToBlack1, 4Rating1, 4TrafficLights1, 5Arrows1, 5ArrowsGray1, 5Rating1, 5Quarters1
officecli add data.xlsx /Sheet1 --type cf \
--prop sqref=E2:E100 \
--prop type=iconset \
--prop iconSet=3Arrows
officecli add data.xlsx /Sheet1 --type cf \
--prop sqref=F2:F50 \
--prop type=iconset \
--prop iconSet=5Rating \
--prop reverse=true \
--prop showValue=false| Property | Default | Description |
|---|---|---|
sqref |
(required) | Target range |
type |
(required) |
formulacf (use --type formulacf) |
formula |
(required) | Condition formula (e.g., =$A2>100) |
font.bold |
Bold on match | |
font.color |
Font color on match (hex RGB) | |
fill |
Fill color on match (hex RGB) |
officecli add data.xlsx /Sheet1 --type cf \
--prop sqref=A2:D100 \
--prop type=formulacf \
--prop formula='=$C2>1000' \
--prop fill=C6EFCE \
--prop font.color=006100
officecli add data.xlsx /Sheet1 --type cf \
--prop sqref=A2:A100 \
--prop type=formulacf \
--prop formula='=ISBLANK(A2)' \
--prop fill=FFC7CEBased on OfficeCLI v1.0.48