User Guide
04.7 · Direct Costs

Formulas in Direct Costs

Any numeric cell (Qty, Rate, Total, custom columns) accepts a formula. Start typing with = just like a spreadsheet. Full formula reference lives in section 07.

Quick Examples

= L5 * 2               Twice line 5's total.
= #lq10 + #lq11        Sum of line 10 and line 11 quantities.
= #labour_rate * 1.15  Project parametric × 1.15.
= IF(L3 > 1000, L3*0.9, L3)   Bulk discount above $1,000.
= SUMCC("Volume")      Sum of the "Volume" custom column.

Where Formulas Live

CellScopeCan reference
Direct Cost item Qty / Rate / TotalGlobalItems (L#, #lq#, #lt#, #lr#), project parametrics, custom columns.
Breakdown Qty / Rate / TotalScoped to this breakdownBreakdown lines (L#, #lq#), scoped parametrics, project parametrics.
Custom column cellGlobalSame as items.

References at a Glance

ReferenceMeaning
L10Line 10's default value (total).
#lq10Line 10 quantity.
#lt10Line 10 total.
#lr10Line 10 rate.
L1:L10Range; sums when used bare, or iterable with SUM(L1:L10).
#my_varGlobal or scoped parametric called my_var.
#cc.ColumnNameCustom column value on this row.
[MY_VAR]Alternate bracket syntax (case-insensitive).

Typical Patterns

Quantity from a project parametric (great for area- or count-based projects):

Qty  = #floor_area * 1.05    // 5% waste
Rate = ResourceRate          // populated from resource

Bulk or per-unit discount:

= IF(L7 > 5000, L7 * 0.925, L7)

Cross-line sum with labels:

L20  "Sub-total labour"      SUM(L10:L19)
L30  "Sub-total material"    SUM(L21:L29)
L40  "Grand total"           L20 + L30

Carbon-adjusted rate:

= #base_rate * (1 + #carbon_adj/100)

Evaluation Order

The engine parses your formula, tokenises, builds an AST, and evaluates it. Dependencies are tracked — if L5 changes and L7's formula references L5, L7 recalculates automatically.

Circular references are detected and rejected before the formula is saved.

Error Display

On the cellMeaning
#ERRSyntax error; hover for description.
#CIRCCircular reference.
#NAME?Unknown variable or function.
#DIV/0Division by zero.

Wrap risky expressions with IFERROR(expr, fallback) to handle gracefully.

Full Function Reference

70+ functions — see 07.4 Built-in Functions Reference or Appendix B (quick card) for the complete list.