User Guide
07.3 · Formula Engine

Variable and Line References

Formulas refer to other cells and values using one of three syntaxes.

1. Line References (other rows)

SyntaxMeaning
L10Line 10's default value (typically Total).
#lq10Line 10 Quantity.
#lt10Line 10 Total.
#lr10Line 10 Rate.
L1:L10Range of lines (used directly = sum; used in SUM() = list).
2:10Shorthand range (defaults to total).

Range Behaviour

A bare range like L1:L10 in an arithmetic expression is implicitly summed:

= L1:L10                    → Σ totals from L1 through L10
= SUM(L1:L10)               → same thing, explicit
= AVERAGE(L1:L10)           → average
= MAX(L1:L10) - MIN(L1:L10) → range span

Breakdown vs Main Grid

Inside a breakdown's formula context, L# refers to breakdown lines, not main grid rows. To reach the parent item's value from a breakdown, use its Project parametric or pass data via a custom column.

2. Variable References (defines)

SyntaxMeaning
#variable_nameStandard reference, case-insensitive.
[VARIABLE_NAME]Alternate bracket syntax.

Rules:

  • Starts with a letter.
  • Contains letters, digits, underscores.
  • Case-insensitive (#rate, #Rate, #RATE all point to the same define).

Examples:

= #floor_area * 1.1
= [LABOUR_RATE] * 40

The resolution order is:

  1. Local scoped parametric (this breakdown).
  2. Parent scoped parametric (e.g. item-level).
  3. Global project define.
  4. Live-computed defines (see 07.5).

If none matches, #NAME? is returned.

3. Custom Column References

SyntaxMeaning
#cc.ColumnNameValue of the custom column on this row.

Plus the aggregate family covered in 07.8: SUMCC, AVGCC, MINCC, MAXCC, COUNTCC, SUMIFCC, COUNTIFCC, AVGIFCC.

Line Numbers Are Stable

The LineNumber column is auto-maintained. If you insert a row between L5 and L6, TX1:

  • Re-sequences line numbers.
  • Rewrites any formula referencing affected lines (L7 + L8 becomes L8 + L9).

This means your formulas survive inserts and deletes without manual fix-up.

Watch Out

  • Deleting a referenced line leaves #REF in the formula — TX1 doesn't delete rows that are referenced without asking first.
  • Renaming a project parametric updates all formulas automatically (the rename propagates via the dependency graph).