Formulas and calculated columns
A Formula column calculates a value — a number, a text or a date — automatically from other columns in the same row — like a spreadsheet cell. It is read-only and recalculates itself whenever the source values change. Alongside it live three sibling column types that also derive their value instead of storing one: Lookup, Rollup, and Reverse links, which read through the connections between tables.
Referencing columns
You write the formula in the table's Structure editor, when the column type is Formula. Inside it, reference another column by writing its name in curly braces: {Column name}. Each reference enters with its value:
{Price} * {Quantity}- Number, decimal, currency, rating, progress, and other formula columns enter with their numeric value.
- A checkbox counts as 1 when checked and 0 when not.
- A date enters as a date: {End} - {Start} gives the days between two dates, {Date} + 30 gives a date, and today() is today.
- Text, select, tags, e-mail, URL and phone enter as text: you can compare them ({Status} = "Done"), join them with & and use them in text functions — only arithmetic is not allowed (the editor says so as you type). Attachment, image and reference columns cannot be used.
- An empty cell is blank: false in a test (if({Date}, "scheduled", "no date")), equal to "" and nothing when joining text. In arithmetic an empty number counts as 0, while an empty date leaves that calculation empty. isblank({Column}) tells whether it is empty.
Pulling from another table
When the row has a Reference column pointing to another table, the formula can read a field of the linked record with a dot: {Reference.Column}. It uses the first linked record of that reference.
{Product.Unit price} * {Quantity}Operators
- Addition, subtraction, multiplication and division: + − * /
- Division remainder: % between two values; 10% alone is a percentage (0.1)
- Parentheses to group: ( )
- Negative/positive sign (unary): -{Column}
- Power: ^
- Join text: & — {First name} & " " & {Last name}
- Comparisons: > < >= <= = <> — they give 1 (true) or 0 (false); text is compared ignoring upper/lower case
Functions
- round(x[, places])
- Rounds x (optionally to a number of decimal places).
- abs(x)
- Absolute value (no sign).
- floor(x) / ceil(x)
- Rounds down / up.
- sqrt(x)
- Square root.
- pow(x, y)
- x raised to the power of y.
- min(...) / max(...)
- Smallest / largest among the given values.
- sum(...) / avg(...)
- Sum / average of the given values.
- if(condition, a, b)
- a when the condition is true (not 0), otherwise b — a and b can be numbers, text in quotes or dates.
- and(...) / or(...) / not(x)
- 1 when all / any of the values are true; not(x) inverts.
- today()
- Today (a date).
- year(d) / month(d) / day(d)
- Year, month (1–12) or day of a date.
- concat(...)
- Joins the values into one text (the same as &).
- upper(t) / lower(t) / trim(t)
- Text in upper case / lower case / without extra spaces.
- len(t)
- Number of characters.
- left(t, n) / right(t, n)
- The first / last n characters.
- isblank(x)
- 1 when the value is empty (no date, no number, empty text); 0 otherwise.
- weekday(d[, type])
- Day of the week: 1 = Sunday … 7 = Saturday; with type 2, 1 = Monday … 7 = Sunday.
- dateadd(d, n[, unit])
- The date plus n days, or "weeks", "months", "years" (a negative n goes back). Jan 31 + 1 month = Feb 28. edate(d, n) adds n months.
- datediff(start, end[, unit])
- From start to end in days (default), or whole "weeks", "months" or "years" — datediff({Birth date}, today(), "years") is the age.
- formatdate(d[, pattern])
- The date as text: dd, mm, yyyy (or aaaa), yy, mmm/mmmm (month name), ddd/dddd (weekday name) — formatdate({Date}, "mmmm yyyy").
- find(part, t[, start]) / contains(t, part)
- Position of part inside t (from 1; 0 when it is not there) / 1 when t contains part. Upper/lower case does not matter.
- substitute(t, old, new)
- Replaces every occurrence of old by new.
- mod(a, b)
- Remainder of a divided by b, with the sign of b (mod(-3, 2) = 1).
Examples
{Price} * {Qty} * (1 - {Discount})round(({Grade1} + {Grade2} + {Grade3}) / 3, 1)max({Target} - {Achieved}, 0)if({Total} > 1000, {Total} * 0.05, 0){Due date} - today()if({Total} > 1000, "high", "low"){First name} & " " & upper({Last name}){Start} + 30if(isblank({Due date}), "no due date", {Due date} - today())datediff({Start}, {End}, "months")if(weekday({Date}, 2) > 5, "weekend", "weekday")When a formula shows empty
A formula prefers showing nothing over showing a misleading number. The cell stays empty when:
- The formula cites a column name that does not exist (or was renamed).
- A cross-table reference is broken — the linked record or target column was deleted.
- The columns form a circular dependency.
- The math is invalid: division by zero or a malformed expression.
- A calculation uses an empty date ({Date} + 30, today() - {Date}) — a test or isblank() with it still works.
Decimal places and display
The column takes the type of the result. A numeric result has decimal places (the default follows the round() around the formula) and takes part in sums, charts, and the Analysis view like any other number column. A text result shows as text and a date result as a date, and they sort and filter like columns of those types.
Lookup, Rollup, and Reverse links
Three more column types derive their value from the connections between tables. They are their own column types — you add them in the Structure editor like any column, not inside a formula:
- Lookup
- Pulls a field of the linked record, as-is (text, date, number…). You configure Via reference… (which linking column to follow) and Field to pull…. With multiple linked records it reads the first one.
- Rollup
- Aggregates a field across ALL the linked records: count, sum, average, minimum, or maximum. Non-numeric values are ignored instead of counting as 0.
- Reverse links
- Shows, on each row, the records of another table that reference it — the other direction of a Reference column. You configure the Source table and the Linked via column.