data_validation
Add or remove data validation rules on Excel cell ranges to control input with dropdowns, numeric bounds, dates, or custom formulas.
Instructions
Add or remove data validation rules on a cell range.
Args: action: "dropdown", "numeric", "date", "remove", or "formula". file_path, sheet_name: Target workbook and sheet. cell_range: Range to apply validation. options: For dropdown lists, list of allowed values. source_range: Alternative dropdown source range. operator, value1, value2: Numeric operator and bounds for numeric validation. date1, date2: Date bounds for date validation. allow_blank, error_style, error_title, error_message, prompt_title, prompt_message: UX controls. formula: Custom formula when action=="formula".
Returns: str or dict: Result or validation metadata.
Notes: - "remove" is destructive for validation rules; this does not delete values, only rules.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date1 | No | ||
| date2 | No | ||
| action | Yes | ||
| value1 | No | ||
| value2 | No | ||
| formula | No | ||
| options | No | ||
| operator | No | ||
| file_path | Yes | ||
| cell_range | Yes | ||
| sheet_name | Yes | ||
| show_error | No | ||
| allow_blank | No | ||
| error_style | No | stop | |
| error_title | No | ||
| prompt_title | No | ||
| source_range | No | ||
| error_message | No | ||
| prompt_message | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |