Intermediate · Lesson 08 of 22

Introduction to Formulas

Syntax, objects, functions, chaining, thisRow, If(), SwitchIf() — everything you need to write your first real Coda formula.

⏱ ~25 min 🔣 Formula syntax ✅ Prerequisite: Lesson 07
01 — What is a Formula? 02 — Objects and Functions 03 — Two Writing Styles 04 — thisRow 05 — If() and SwitchIf() 06 — Formula Anatomy Practice
01 — What is a Formula?

Formulas turn static data into live intelligence.

In Coda, a formula always starts with =. You can write formulas in two places — column cells and canvas cells — and they behave differently in each context.

Column formula

Written in the column header. Applies automatically to every row — just like a spreadsheet column formula. You write it once; Coda runs it for every row.

= (in the column header)
thisRow.[Due Date] < Today()

Canvas formula

Written anywhere in the canvas (the document area). Standalone — it computes once, not per-row. Use for summaries, totals, dashboards.

= (in a canvas text block)
Count(Tasks.Filter(
  [Status] = "Done"))
Key distinction In a column formula, thisRow is available because the formula runs per row. In a canvas formula, there is no "current row" — you reference the table directly.
02 — Objects and Functions

Objects are nouns. Functions are verbs.

Every Coda formula is built from two kinds of building blocks. Once you see the grammar, reading any formula becomes much easier.

📋

Objects (nouns)

Things that exist in your doc — a table, a row, a column, a page. You reference them by name.

Examples: Tasks, thisRow, [Status]

⚙️

Functions (verbs)

Actions that compute or transform. Always followed by parentheses. Take arguments separated by commas.

Examples: Filter(), Count(), If()

🔗

Arguments

The inputs a function needs, inside the parentheses. Could be a column reference, a string, a number, or even another formula.

Syntax: FunctionName(arg1, arg2)

Objects & Functions — Quick Reference
KindExampleWhat it refers to
Table (object)TasksThe Tasks table in your doc
Column (object)[Status]The Status column — use square brackets
Current row (object)thisRowThe row this column formula is running on
FunctionFilter(table, condition)Returns rows matching the condition
FunctionCount(list)Counts items in a list or table
FunctionSum(list)Adds all numbers in a list
03 — Two Writing Styles

Wrapping vs Chaining

Coda supports two syntaxes for combining functions. Both produce identical results — but one is dramatically easier to read as formulas grow complex.

Wrapping (nested)

Functions nest inside each other like Russian dolls. Read from inside-out. Works fine for simple formulas, but becomes hard to parse quickly.

Count(Filter(Tasks,
  [Status] = "Done"))

Works — but you have to count parentheses to understand the structure.

Chaining (dot notation) ✓

Functions chain left-to-right with a dot. Read like English prose. Preferred for any formula with more than one step.

Tasks
  .Filter([Status] = "Done")
  .Count()

Same result — reads as "start with Tasks, filter to Done, count them."

When to use each Single-function formulas can use either style. Two or more chained operations → always use dot notation. Your future self will thank you.

Here's a more complex example that shows why chaining wins at scale:

Wrapping — hard to parse
Average(Filter(Tasks, [Assignee] = "Alice").[Estimate])
Chaining — reads naturally
Tasks
  .Filter([Assignee] = "Alice")
  .[Estimate]
  .Average()
04 — thisRow

Referencing the current row

Inside a column formula, thisRow refers to whichever row the formula is currently running on. It's how you access the values in the same row — without hardcoding a row number.

thisRow.[Due Date] < Today()
Object thisRow — the current row being evaluated
Column access [Due Date] — grab the Due Date value from this row
Operator < — "is earlier than"
Function Today() — returns today's date dynamically

This formula placed in a Checkbox column returns true when the task's due date has already passed — giving you an instant "Overdue" flag. It updates every day automatically because Today() is dynamic.

thisRow is only available in column formulas If you write a formula in the canvas (not in a column header), there is no current row and thisRow will produce an error. In canvas formulas, reference columns via the table: Tasks.[Due Date].
05 — If() and SwitchIf()

Conditional logic: If(), SwitchIf()

Conditional formulas let a column's value change depending on other values in the row. They're the foundation of calculated status fields, dynamic labels, and traffic-light indicators.

If()

The basic conditional. Takes three arguments: a condition, what to return when true, and what to return when false.

If(thisRow.[Status] = "Done", "✓", "○")
Function If() — evaluates a condition
Condition (arg 1) thisRow.[Status] = "Done" — true or false?
True value (arg 2) "✓" — returned when condition is true
False value (arg 3) "○" — returned when condition is false

SwitchIf() — multiple conditions

When you have more than two cases, nesting If() inside If() gets messy fast. SwitchIf() handles multiple branches cleanly — condition/value pairs, with an optional final fallback.

Priority traffic light — SwitchIf()
SwitchIf(
  thisRow.[Priority] = "High",   "🔴",
  thisRow.[Priority] = "Medium", "🟡",
  "🟢"   // fallback — everything else is Low
)
SwitchIf() vs nested If() SwitchIf(condition1, value1, condition2, value2, fallback) — pairs of condition/value, ending with an optional fallback. Much cleaner than If(cond1, val1, If(cond2, val2, fallback)) for three or more cases.
06 — Formula Anatomy

Reading a formula at a glance.

Let's put it all together. Here's a real-world column formula for a "Status Icon" column that combines chaining, thisRow, and SwitchIf.

Tasks — Status Icon column formula
= (column formula)
SwitchIf(
  thisRow.[Status] = "Done",      "✅",
  thisRow.[Status] = "Blocked",  "🔴",
  thisRow.[Due Date] < Today(), "⚠️",
  "⬜"   // fallback: not started, not overdue
)
Task Status Select Due Date Date Status Icon Formula
Write landing page Done Apr 10
Design mockups Blocked Apr 12 🔴
Send proposals To Do Mar 28 ⚠️
Review analytics To Do May 5
SwitchIfthisRow.[Status] = "Done", "✅"thisRow.[Status] = "Blocked", "🔴"thisRow.[Due Date] < Today(), "⚠️""⬜" )
Function SwitchIf() — evaluates condition/value pairs in order; first match wins
thisRow reference Each condition reads values from the current row using thisRow.[Column]
Dynamic date Today() recalculates daily — overdue tasks auto-flag without any manual update
Fallback "⬜" is the last argument — returned when no condition matched
Practice

Fill in the blanks.

Formula Syntax

5 Questions
Question 1 of 5
Every Coda formula starts with the character: ___
Question 2 of 5
To reference the current row's Due Date inside a column formula, you write: ___________.[Due Date]
Question 3 of 5
Complete the formula: __(thisRow.[Status] = "Done", "✓", "○")
Question 4 of 5
Tasks.Filter([Status] = "Done").Count() uses the __________ style (also called dot notation).
Question 5 of 5
For three or more conditional branches, use __________() instead of nesting If() inside If().
← Prev Automations & Buttons Lesson 07