Formula syntax basics
A cell becomes a formula cell when its value starts with=. Everything after the = is evaluated by the GridOS expression parser.
Infix arithmetic
The engine parser does accept the four basic infix operators (+, -, *, /) plus exponentiation (^ or **), so a hand-typed formula like:
But agents never emit infix. The built-in finance and general agents are instructed to use named primitives (
MULTIPLY, MINUS, etc.) for three reasons: auditability (every computation is a named registry call), macro composability (primitives can be wrapped into user macros easily), and cross-provider determinism (LLMs disagree about operator precedence but agree about function names).So you’ll see =MULTIPLY(C3, 0.4) in agent output, not =C3*0.4 — even though both work. Stick with named primitives in anything the agent will read or modify.Cell references
Reference another cell by its A1 address inside any function argument:Excel-ism tolerance
LLMs trained on Excel examples sometimes emit formulas with Excel-specific syntax. The parser normalizes three of the most common patterns before tokenizing, so these work transparently:
GridOS has no fill-down semantics, so the
$ in absolute refs is semantically meaningless here — it’s just noise the parser strips. Similarly, the percent normalization means =MULTIPLY(C5, 15%) and =MULTIPLY(C5, 0.15) compute identically.
Range syntax
Pass a rectangular block of cells to a function usingstart:end notation:
0 to numeric functions.
Range arguments (
A1:B6) are only valid as direct function arguments, not as sub-expressions. =SUM(AVERAGE(A1:A5), B1) is forbidden in cells for the same reason nested calls are — use a macro if you need that composition.Cross-sheet references
Formulas can reach cells on other sheets in the same workbook withSheetName!A1 syntax. Sheet names containing spaces or special characters must be single-quoted:
#REF! at evaluation time.
The agent knows the cross-sheet grammar — ask it “pull A1 from Sheet 2 into B2” or “sum the Data sheet’s A1:A10 into the summary sheet” and it emits the correct qualified reference. The ACTIVE SHEET context in its system prompt tells it where writes land; cross-sheet refs only appear when the user actually asks to read from another sheet.
v1 caveat: the initial read is correct, but upstream changes on the source sheet don’t auto-propagate to the dependent cell. Re-evaluate by touching the formula (enter the cell, press Enter) or by re-running the formula through
/grid/cell. Full cross-sheet dirty-tracking is on the roadmap.Nested calls
The reason: the preview/apply flow inspects each cell’s top-level formula to compute dependencies and run the pre-apply safety guard. Nesting would make that analysis recursive and much harder to audit. Macros opt in to that complexity explicitly.Built-in primitives
These 21 functions are always available. Agents receive the authoritative list at runtime, so they will never invent names outside this table. Plugins can add more.Math functions
- Arithmetic
- Rounding & absolute
Comparison functions
All comparisons returntrue or false and are most useful as the first argument to IF.
Logical functions
Empty strings and
null are treated as falsy by IF, AND, OR, and NOT. Every other value — including 0 and false — follows standard Python truthiness rules.Formula examples by category
- Finance
- Comparison & logic
- Aggregation