Documentation

Formula Columns


A formula column computes its value automatically from other columns in the same row. The cell is read-only in the spreadsheet — its value updates whenever a referenced column changes. Useful for derived quantities like interval thickness, unit conversions, RQD, or any value you’d otherwise type a formula for in Excel.

Create a formula column

In Templates → Data Tables, add a column and set its Type to formula. A Formula field appears on the column card. Enter a mathjs expression and save.

The same applies to drillhole template fields — set type to formula and provide an expression.

Expression syntax

Formulas use mathjs — the same expression engine as the validation custom rule. Within an expression, reference any other column in the same row by its name.

Examples

FormulaResult
depth_to - depth_fromInterval thickness
(au_g_t * specific_gravity) / 31.1035Au g/t to oz/t conversion
core_recovery / (depth_to - depth_from) * 100Recovery percentage
(rqd_length / drilled_length) * 100RQD percentage
depth_from + (depth_to - depth_from) / 2Midpoint depth
cu_pct * tonnes_per_m * (depth_to - depth_from)Contained metal

Any valid mathjs expression is supported — arithmetic, comparison, logical, conditional (x > 0 ? x : 0), trigonometric, etc.

Behaviour in the spreadsheet

  • Purple type badge in the templates editor identifies formula columns.
  • Greyed out cells in the spreadsheet — you cannot click into them to type.
  • Auto-recalculation. Whenever you edit a referenced column, the formula re-evaluates and the cell updates immediately.
  • Empty inputs. If a referenced column is blank, the formula cell is also blank (the formula doesn’t run on partial input).
  • Errors. If the expression fails (divide by zero, undefined column, syntax error), the cell shows ERROR. Fix the expression in Templates and the cell recalculates.

Tips

  • Reference exact column names. Names are case-sensitive. If your column is depth_from, the formula must use depth_from — not Depth From or depthFrom.
  • Use formula columns for derived values, not for one-time calculations. If you only need a value once, calculate it in Excel before importing. Formula columns shine when the underlying data changes.
  • Combine with validation. Run a custom validation rule against the formula’s output too — e.g., interval_m > 0 && interval_m < 100.
  • No side effects. Formulas are pure functions of other columns in the same row. They cannot reference other rows, other tables, or the drillhole’s collar fields.