Formulas
Add a formula such as {{ sum }} to a row to show totals, counts, or task progress from the rows nested below it. Results update as you edit those rows.
Show a total
- Type
Shopping ($) Total {{ sum }}in the row where you want the total - Indent these three rows one level below it:
Rice $12.00,Tea $3.50, andBread $2.50 - Move the cursor to another row. The formula shows the total,
18.00
Shopping ($) Total {{ sum }}
Rice $12.00
Tea $3.50
Bread $2.50
Place the cursor on the result to edit the formula.
Spaces inside the braces are optional: {{ sum }} and {{sum}} work the same way.
Available formulas
| Formula | Result |
|---|---|
{{ sum }} | Total of numbers |
{{ count }} | Rows, including empty rows |
{{ chars }} | Characters, including spaces |
{{ words }} | Words, excluding spaces and emoji |
{{ todo }} | Unchecked checkboxes |
{{ done }} | Checked checkboxes |
{{ progress }} | Checked / all checkboxes |
Add {{ words }} to a draft and its sections to show their word counts:
Draft {{ words }}
Introduction {{ words }}
Write your text here.
Chapter 1 {{ words }}
Write your text here.
The draft total includes the section headings. Use {{ chars }} to count characters instead. Both counts exclude Markdown formatting marks.
If no rows are included, the result is 0, or 0/0 for progress.
Show task progress
Type Travel preparation {{ progress }} Remaining {{ todo }} in the parent row. Add tasks below it using checkbox syntax:
[ ] Check passportcreates an unchecked task[x] Pack bagscreates a checked task
Which rows are included
By default, {{ sum }} includes all rows nested under it: children, grandchildren, and so on. It means the same as {{ descendants.sum }}.
Shopping {{ sum }}
Food 100
Snacks 200
Household items 300
In this example, {{ sum }} shows 600. Change it to {{ children.sum }} to include only direct children. The result is then 100 + 300 = 400.
Other scopes also start from the row containing the formula.
| Example | Rows included |
|---|---|
{{ parent.sum }} | Only the parent row |
{{ siblings.sum }} | Other sibling rows, excluding this row |
{{ this.sum }} | Only this row |
{{ subtree.sum }} | This row and all rows nested under it |
Replace sum with count, progress, or another formula name to use the same scopes.
- Notes are excluded
- Collapsed rows and rows hidden by filters are included
parentgives an error if the row has no parent- For a top-level row,
siblingsincludes the other top-level rows
Numeric inputs
sum adds the numbers it finds in row text. Use a dot for decimals and commas to separate groups of three digits. Negative numbers and full-width characters also work.
A sum keeps the greatest number of decimal places in its inputs. For example, 12.00, 3.50, and 2.50 show a total of 18.00. Inputs that are all integers give an integer result. This display rule does not apply to arithmetic expressions such as sum + 1.
| Input | Value included |
|---|---|
$12.00, 12 USD, 5kg | 12, 12, 5 (no conversion) |
30%, 123ABC | 30, 123 |
B2B, dates such as 2026-10-31, URLs, numbers in code | Excluded |
12,50, 1 234, 1h30m, 1e3 | Error |
Currencies and units are not converted or checked, so use values that make sense to add together. Place the cursor inside a formula to highlight the numbers it includes. To exclude a model number such as 123ABC, wrap it in backticks: `123ABC`.
A row can contain several values. For example, $10 $20 gives 30. Numbers separated only by spaces, such as 10 20, give an error.
Add durations
Write 1 hour 30 minutes as 1:30.
Work time {{ sum }}
Design 13:00
Implementation 12:30
This example shows a total of 25:30 (25 hours 30 minutes).
If you mix durations and other numbers, the formula shows a Mixed units error.
Arithmetic
Use +, -, *, /, and parentheses to calculate with numbers and formula results.
{{ 1200 * 12 }}→14400{{ (2 + 3) * 4 }}→20{{ sum / 2 }}→ half the descendant sum
Inside formulas, write numbers using digits 0–9 and a dot for decimals.
Duration results support addition and subtraction only. You cannot multiply or divide them, or write a duration such as 13:00 directly inside a formula.
progress cannot be used in arithmetic. Dividing by zero gives a Division by zero error.
Notes
- Formulas and their results are excluded from other calculations. For example,
Subtotal {{ sum }}in a child row does not count the subtotal a second time in the parent total - To keep
{{ sum }}as text without calculating it, add a backslash:\{{ sum }}. Formulas inside code, math, links, or image syntax are not calculated either - Export normally uses calculated results. Choose Source to export the original formula text
- Turn off Settings > Appearance > Content > Formulas to show and export the original text, such as
{{ sum }}
