eval_formula
Evaluate an Excel-style formula in a private scratch cell and return the computed value with its type, without writing to user-visible cells.
Instructions
Evaluate an Excel-style formula in a private scratch cell and return the computed value. Nothing is written to user-visible cells. Returns {type, value} where type is one of:
"number" — value is a JS number
"str" — value is a string
"bool" — value is a JS boolean
"error" — value is the Excel error code (e.g. "#REF!", "#NAME?")
"empty" — value is null (formula returned an empty cell)
Use for:
Quick checks: "=SUMIFS(OrderStatus, "金额", "*")" → total
Sanity-test a candidate template before set_field_rule
BLOCKREF / BLOCKREFS lookups against any block in the workbook
Leading "=" is optional — it is added automatically if missing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expr | Yes | Formula, with or without leading "=". E.g. "SUM(A1:A10)" or "=BLOCKREF(\"orders\", \"O001\", \"金额\")". |