conditional_format
Apply, list, or remove conditional formatting rules on Excel sheets, covering highlights, data bars, icon sets, and formula-based conditions.
Instructions
Apply, list, or remove conditional formatting rules on a sheet.
Args: action: One of "apply", "highlight", "formula_rule", "remove", "top_bottom", "above_below_average", "list". file_path, sheet_name: Target workbook and sheet. cell_range: Range to apply/remove rules. format_type, start_color, mid_color, end_color, bar_color, icon_style: Visual rule parameters. operator, formula: Rule parameters for highlight/formula rules. font_color, bg_color, is_top, rank, percent, is_above, equal_average: Additional rule params.
Returns: str | dict | list: Depends on action.
Notes: - Removing rules is destructive to formatting state. - Consider documenting rule precedence and Excel-specific limitations.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rank | No | ||
| action | Yes | ||
| is_top | No | ||
| formula | No | ||
| percent | No | ||
| bg_color | No | FFC7CE | |
| is_above | No | ||
| operator | No | ||
| bar_color | No | FF638EC6 | |
| end_color | No | 00FF00 | |
| file_path | Yes | ||
| mid_color | No | FFFF00 | |
| cell_range | No | ||
| font_color | No | 9C0006 | |
| icon_style | No | 3Arrows | |
| sheet_name | Yes | ||
| format_type | No | ||
| start_color | No | FF0000 | |
| stop_if_true | No | ||
| equal_average | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |