Numbers: set formula
numbers_set_formulaInsert a formula into one cell of a Numbers file and return the computed result. Use dry_run to preview changes without modifying the file.
Instructions
Put a formula in one cell, e.g. ref "D10", formula "=SUM(D2:D9)"; Numbers computes it and the result is returned. Every other cell's input is verified unchanged. Needs macOS + Numbers, file closed. dry_run=true previews the change on a copy without touching the file. Use for a cell that calculates (=SUM…); Numbers computes the result. For a plain value use numbers_edit_cell. Needs the Numbers app.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | Yes | One cell in A1 notation, e.g. "B2". | |
| path | Yes | Path to the .numbers file (absolute, or starting with ~). | |
| sheet | No | Sheet name. Omit when the file has one sheet (iwork_read lists sheets and tables). | |
| table | No | Table name on that sheet. Omit when the sheet has one table. | |
| dry_run | No | true = make the change on a throwaway copy, run every check, and return what would change; the file itself is not touched. Use it before broad or risky edits and show the user. | |
| formula | Yes | The formula, starting with "=", e.g. "=SUM(B2:B9)". |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||