Guide

Formulas

Every text-shaped cell in a Dock table can hold a spreadsheet formula. 39 functions, Sheets-compatible A1 references, dependents update live when sources change. (Looking for the table itself, or for column types and bulk ops? See table mode.)

Entering a formula

Select any cell, press =, and the formula bar above the table takes focus with the equals sign already seeded. The bar shows the formula source; the cell shows the computed value once you commit with Enter (or Tab to commit + move right).

Cells can also be edited directly: double-click a cell, type =SUM(B1:B10), and press Enter. The press-= keystroke handoff is identical — the bar always hosts the live editing surface, so autocomplete, error preview, and the function picker work the same regardless of where you started typing.

While editing, the bar's right-side readout previews the computed value (or a plain-language error sentence if the formula is broken). Press Escape to cancel without saving.

The fx picker

Don't remember the function name? Click the fx chip in the formula bar to open the function library. Functions are grouped by category (Math, Logic, Text, Date, Lookup, Predicates) and searchable by name or description. Click any entry to insert FUNCNAME(at the bar's cursor and start filling in arguments.

Cell references & ranges

Dock uses Sheets-style A1 notation. Columns are letters A, B, … Z, AA; rows are 1-indexed numbers. The first defined column is A, the second B, etc.

  • Single cell: =A1 reads the value of column A, row 1.
  • Range: =SUM(B2:B10) sums column B from row 2 to row 10, inclusive.
  • Whole column: =SUM(B:B) sums every value in column B regardless of row count. Handy when the row count grows over time.
  • Cross-column ranges: =SUM(A1:C5) sums every cell in the rectangle from A1 to C5.

Function catalog

Dock ships 39 functions covering the formulas most spreadsheets actually run on. Names match Sheets / Excel where they overlap, so formulas usually paste over directly.

Math

Aggregate + arithmetic across cells and ranges.

Function
Signature
What it does
SUM
(range)
Adds every numeric value in the range. Text values are ignored.
AVERAGE
(range)
Arithmetic mean of every numeric value. Empty + text cells are excluded from the divisor.
COUNT
(range)
Counts numeric cells in the range.
COUNTA
(range)
Counts non-empty cells (numbers, text, or formulas).
MIN
(range)
Smallest numeric value in the range.
MAX
(range)
Largest numeric value in the range.
ROUND
(value, digits)
Rounds to the specified decimal places. Negative digits round to tens, hundreds, etc.
ABS
(value)
Absolute value.
MOD
(dividend, divisor)
Remainder of integer division.
POWER
(base, exponent)
Raises base to exponent. Equivalent to base^exponent.
SQRT
(value)
Square root. Negative inputs return #NUM!.
ROUNDUP
(value, digits)
Rounds away from zero.

Logic

Branching, predicates, and error handling.

Function
Signature
What it does
IF
(test, then, else)
Returns `then` when test is truthy, otherwise `else`. Nestable for multi-arm branches.
AND
(a, b, …)
Returns TRUE only when every argument is truthy.
OR
(a, b, …)
Returns TRUE when at least one argument is truthy.
NOT
(value)
Logical negation.
IFERROR
(formula, fallback)
Returns `fallback` when formula evaluates to any error. Use this to suppress noisy #N/A or #DIV/0! in dashboards.
TRUE
()
Literal TRUE. Use when you need a stable truth value (rare; usually you'd write a comparison).
FALSE
()
Literal FALSE.

Text

Build, slice, and reshape strings.

Function
Signature
What it does
CONCAT
(a, b, …)
Joins arguments end-to-end. Numeric arguments are coerced to their display form. Dock rewrites this to CONCATENATE internally; you type either.
TEXT
(value, format)
Formats a number as a string per the given pattern (e.g. "0.00", "$#,##0.00").
LEN
(text)
Character count.
LEFT
(text, n)
First n characters.
RIGHT
(text, n)
Last n characters.
MID
(text, start, n)
n characters starting at position `start` (1-indexed).
TRIM
(text)
Strips leading + trailing whitespace and collapses internal runs to single spaces.
UPPER
(text)
Uppercases every letter.
LOWER
(text)
Lowercases every letter.

Date

Date arithmetic. Dates serialise as days since 1899-12-30 internally.

Function
Signature
What it does
TODAY
()
Today's date (no time component). Updates on every recompute.
NOW
()
Current date + time.
YEAR
(date)
4-digit year.
MONTH
(date)
Month number, 1-12.
DAY
(date)
Day of month, 1-31.

Lookup

Find values in a range by position or match.

Function
Signature
What it does
INDEX
(range, row, col?)
Returns the cell at the given (row, col) inside the range. 1-indexed. col is optional for 1-D ranges.
MATCH
(needle, range, mode?)
1-based position of needle in range. mode=0 for exact match (the common case).

Conditional aggregation

SUM + COUNT variants gated by a predicate.

Function
Signature
What it does
SUMIF
(range, criterion, sum_range?)
Adds cells in `sum_range` whose `range` row matches criterion. Skip `sum_range` to sum the same cells you're testing.
COUNTIF
(range, criterion)
Counts cells matching the criterion. Criterion accepts comparison ops (e.g. ">100", "<>active").

Predicates

Type checks. Pair with IF or IFERROR for defensive formulas.

Function
Signature
What it does
ISBLANK
(value)
TRUE when the cell is empty (no value, not a 0 or empty string).
ISNUMBER
(value)
TRUE when the value parses as a number.
ISTEXT
(value)
TRUE when the value is non-numeric text.
ISLOGICAL
(value)
TRUE when the value is a literal TRUE or FALSE.
ISERROR
(value)
TRUE when the value is any error type. Use to count broken cells in a sheet.
ISNA
(value)
TRUE specifically for #N/A. Narrower than ISERROR.

Worked examples

Suppose you have a 3-row table with columns price (B), qty (C), subtotal (D), tax (E), total (F) — same shape as the demo workspace at /dock/sheets-formula-demo-2.

Per-row mathtext
D1 = =B1*C1            // line-item subtotal
E1 = =D1*0.0875        // 8.75% sales tax
F1 = =D1+E1            // grand line total
Roll-up totals (row 4 = Total row)text
D4 = =SUM(D1:D3)       // sum of all subtotals
E4 = =SUM(E1:E3)       // sum of all tax
F4 = =SUM(F1:F3)       // grand total of all rows
Defensive formulastext
=IF(B2="", "—", B2*C2)            // show a dash when price is missing
=IFERROR(D2/qty_zero, 0)          // suppress divide-by-zero
=ROUND(AVERAGE(B1:B10), 2)        // average price to 2dp
=CONCAT("Q1 revenue: $", SUM(F1:F3))  // mixed text + roll-up

Live recompute

Change a source cell and every dependent updates in the same commit. Editing the qty for Bananas from 20 to 40 in the example above recomputes Bananas' subtotal, tax, and total — and the bottom Totalrow's subtotal / tax / total all roll up — without a page reload.

Dock's engine evaluates synchronously on every commit. The formula bar's right-side readout shows the fresh value the moment you press Enter; the cell itself, and every dependent cell, persists the new value in the same atomic write. Other tabs receive the update via the real-time stream within ~50ms.

Errors

When a formula can't evaluate, the cell shows the canonical Sheets / Excel code in soft red mono — never raw [Object object]or empty whitespace. Select the cell to read the plain-language explanation in the formula bar's right-side readout; hover without selecting and the same sentence appears as a tooltip.

Code
When it fires
Fix
#DIV/0!
Dividing by zero or by an empty cell.
Fill the divisor cell, or wrap in IFERROR(…).
#REF!
A reference points to a deleted column or row, or to a row outside the sheet.
Restore the column / row, or update the formula to a live address.
#NAME?
Function name is unknown or a cell reference is malformed.
Check spelling against the catalog above. Common typo: ranges with a colon vs comma.
#VALUE!
Argument type doesn't fit the function (e.g. SUM on a column of dates).
Wrap text values in VALUE(), or use a function tuned to the column's type.
#NUM!
Numeric argument is out of range (e.g. SQRT of a negative number).
Clamp the input, or use IF to gate the formula.
#N/A
A lookup (MATCH, INDEX) couldn't find a match.
Verify the lookup key exists, or wrap in IFERROR(formula, "not found").
#CYCLE!
A formula refers, directly or indirectly, back to its own cell.
Break the loop. Cells can't depend on themselves.

Persistence model

Formula cells store as a JSON carrier on the row's data object:

One formula cell at restjson
{
  "formula": "=SUM(B1:B10)",
  "value":   "318.42"
}

The formula field is the source text shown in the bar; the valueis the most-recently computed display value, which the cell renders directly (so the page can paint without re-evaluating the engine on every paint). When an upstream source changes, every dependent's carrier is re-persisted in the same atomic write — so a reload always shows the freshest computed value.

Literal (non-formula) cells store as bare strings. The decoder treats anything that doesn't start with {" as a literal, so a cell whose content happens to start with =in the carrier's raw text — but isn't actually a formula carrier — round-trips as text.

Programmatic agents writing rows via the REST API can pre-build carriers (the engine will re-evaluate on hydrate either way), or write plain literal strings and let humans add the formulas in the bar.

Mobile

On touch devices the formula bar opens as a bottom sheet instead of the desktop top-bar. Tap a cell, tap the fx button in the sheet to browse functions, type the formula, and tap Commit. Autocomplete is hidden on coarse pointers in favor of the full-screen function picker, which has bigger tap targets.

Function aliases

A few user-facing names map to HyperFormula's canonical identifiers internally; you can type either form and the bar displays whatever you typed. The carrier persists the canonical form so spreadsheets imported elsewhere stay portable.

  • CONCAT CONCATENATE

Keyboard

=From any selected cell, opens the formula bar with `=` seeded
Type any letterFrom a selected text cell, starts editing in the cell with that letter
EnterCommit formula and move down
TabCommit formula and move right
Shift+EnterCommit formula and move up
Shift+TabCommit formula and move left
⌘+Enter / Ctrl+EnterCommit without moving (stay on cell)
EscapeCancel the in-flight edit; cell reverts to pre-edit state
↑ ↓Navigate the autocomplete dropdown when open
Click `fx` chipOpen the function picker popover

Limitations

  • Cross-surface refsaren't supported yet — you can't write =Sheet2!A1 to read from a sibling table tab. Each surface evaluates in isolation.
  • Array formulas(CSE-style) aren't available. Use a single-cell formula per row + drag-fill to spread.
  • Custom functionsaren't available. The 39-function catalog is the surface.
  • Volatile functions (TODAY, NOW) re-evaluate only on commit, not on a timer. Touching any cell triggers a recompute.

Frequently asked questions

How do I add a formula to a cell in Dock?
Select the cell, press `=`, and the formula bar takes focus with the equals sign seeded. Type the formula (e.g. `=SUM(B1:B10)`) and press Enter or Tab to commit. The cell renders the computed value; the bar shows the formula source.
What functions does Dock support?
Dock ships 39 functions across Math (SUM, AVERAGE, COUNT, MIN, MAX, ROUND, ABS, MOD, POWER, SQRT, ROUNDUP), Logic (IF, AND, OR, NOT, IFERROR, TRUE, FALSE), Text (CONCAT, TEXT, LEN, LEFT, RIGHT, MID, TRIM, UPPER, LOWER), Date (TODAY, NOW, YEAR, MONTH, DAY), Lookup (INDEX, MATCH), Conditional aggregation (SUMIF, COUNTIF), and Predicates (ISBLANK, ISNUMBER, ISTEXT, ISLOGICAL, ISERROR, ISNA).
Does Dock recalculate dependent cells when I change a source?
Yes. When you commit a change to a source cell, every dependent formula cell evaluates and persists in the same atomic write. The cell view updates in the same tick — no reload required. Other tabs receive the update via the real-time stream within ~50ms.
Can I use Google Sheets formulas in Dock?
Most one-cell formulas paste over directly because Dock uses Sheets-compatible A1 references and matches Sheets / Excel function names where they overlap. CONCAT is rewritten to CONCATENATE internally. Cross-sheet references (Sheet2!A1) and array formulas aren't supported yet.
How do I write a formula across multiple columns?
Use a range like `=SUM(A1:C5)` to sum every cell in the rectangle, or combine refs like `=A1+B1+C1`. For whole-column sums, use `=SUM(B:B)` — handy when the row count grows over time.
What does #DIV/0! mean in a Dock formula cell?
The formula is dividing by zero or by an empty cell. Fill the divisor cell, or wrap the formula in IFERROR(...) to suppress the error. Select the cell to read the plain-language explanation in the formula bar.
How are formulas stored in Dock?
Formula cells store as a JSON carrier on the row's data: `{"formula": "=SUM(B1:B10)", "value": "318.42"}`. The formula field is the source; the value field is the most-recently computed display value, which the cell renders directly so the page doesn't need to re-evaluate the engine on every paint.
Can my AI agent write formulas via the REST API?
Yes. POST a row with the cell's value set to the JSON carrier (`{"formula": "=SUM(B1:B10)", "value": ""}`). The engine evaluates on hydrate and the displayed value updates on the next user commit or page interaction. Simpler: write literal strings and let the user add formulas in the bar.
Do formulas work on mobile in Dock?
Yes. On touch devices the formula bar opens as a bottom sheet. Tap a cell, tap the `fx` button to browse functions, type the formula, and tap Commit. Autocomplete is replaced by a full-screen function picker for bigger tap targets.
What happens when I delete a column that's referenced by a formula?
Every formula that references the deleted column shows `#REF!` in the cell. Hover or select the cell to see the plain-language explanation. Restore the column or update the formula to a live address to recover.
  • Table mode — column types, cell selection, copy / paste, find & replace.
  • Rows API — REST surface for writing formula carriers from agents.
  • Keyboard shortcuts — full reference, including formula-mode keystrokes.