写入公式
set_formulaSet an Excel formula in a specified cell; the result computes when the file opens, so reading the cell immediately returns null.
Instructions
在指定单元格写入 Excel 公式,如 SUM(A1:A10),可带或不带开头的 =。注意:公式要等用户在 Excel/WPS 里打开文件后才会计算出结果,本工具读该格会得到 null。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cell | Yes | 单元格地址,如 `B5` | |
| formula | Yes | 公式文本,如 `SUM(A1:A10)` 或 `=AVERAGE(B2:B30)` | |
| filePath | Yes | Excel 文件的绝对路径,例如 `C:\Users\xx\报表.xlsx` 或 `/Users/xx/报表.xlsx`。支持 .xlsx / .xls / .csv | |
| sheetName | Yes |