Formulas (Pro)

A cell that starts with = is calculated when the table renders. The grid keeps what the author typed; only the page sees the number.

Turning it on

Evaluate formulas in the table's options. Off by default, because a price list containing the literal text =call for pricing should not suddenly render an error.

What you can write

=SUM(B2:B9)          =AVERAGE(C2:C10)      =ROUND(B2*1.2, 2)
=MIN(B2:B9)          =MAX(B2:B9)           =MEDIAN(B2:B9)
=COUNT(A2:A9)        =PRODUCT(B2:B3)       =ABS(D4)
=B2*3 + C2           =(A1+A2)/2            =B2^2

References are spreadsheet-style and 1-based: B7, or $B$7 — the dollars are accepted and ignored, since there is nothing here to fill down. Ranges work anywhere a list of values is expected.

Numbers out of formatted cells

=SUM(B2:B4) over a column of $1,200.00 gives 1200 and not zero: the evaluator reads the number out of the formatting, exactly as sorting does. A cell it cannot read as a number contributes nothing rather than breaking the sum.

Formulas referring to formulas

A formula may reference a cell that is itself a formula, and the chain is resolved as deep as it goes. A cycle is detected rather than followed: both cells in the loop report #CIRCULAR!, rather than one of them quietly reporting zero.

What it cannot do

The evaluator is a small recursive-descent parser over arithmetic, cell references, ranges and a fixed function list. It has no access to PHP, to Twig, to your database or to anything else. Cells are author input, and “let authors type an expression” must never quietly become “let authors type code”.

Anything that does not parse renders as #ERROR! — visible, so it gets fixed — and division by zero is an error rather than infinity.

Formatting of results

Whole numbers stay whole: =1+1 is 2, not 2.0000000000. Floating-point noise is rounded away rather than published, so =0.1+0.2 is 0.3. If you want currency formatting or thousands separators, put them in a neighbouring column or format the source values — the result is a number, not a presentation decision.