Intermediate · Lesson 10 of 22

Number & Date Formulas

Arithmetic, Sum, Round, DateAdd, Today(), Now() — compute deadlines, track durations, build live dashboards that update themselves every day.

⏱ ~24 min 🔢 Numbers & dates ✅ Prerequisite: Lesson 09
01 — Number Basics 02 — Aggregate Functions 03 — Rounding & Math Utilities 04 — How Dates Work 05 — Today() and Now() 06 — DateAdd & Date Arithmetic 07 — Extracting & Formatting Dates 08 — Putting It Together Practice
01 — Number Basics

Arithmetic operators and operator precedence.

Coda handles numbers with the same arithmetic operators you know from spreadsheets. Standard order of operations applies: multiplication and division before addition and subtraction. Use parentheses to override precedence.

Arithmetic operators — reference
OperatorMeaningExampleResult
+Addition8 + 311
-Subtraction8 - 35
*Multiplication8 * 324
/Division8 / 32.667
^Power / exponent2 ^ 8256
Precedence example: 2 + 3 * 4 → 14, not 20. Add parentheses: (2 + 3) * 4 → 20.
Percentages Store percentages as decimals — 0.85 represents 85%. Then format the column as "Percent" for display. This keeps math clean: Budget * Rate works correctly when Rate is 0.15, not 15.
02 — Aggregate Functions

Sum, Average, Min, Max

These four functions operate on a list of numbers — either a comma-separated list or an entire column from a table. They're most powerful in canvas formulas where you're summarizing a whole table.

Column aggregates — canvas formula examples
Sum(Tasks.[Estimate])       → total of all Estimate values
Average(Tasks.[Estimate])   → mean estimate
Min(Tasks.[Estimate])       → smallest estimate
Max(Tasks.[Estimate])       → largest estimate
Filtered aggregates — only count completed tasks
Tasks
  .Filter([Status] = "Done")
  .[Estimate]
  .Sum()   → total hours in completed tasks only
Tasks — aggregates in a dashboard canvas block
42h
Total Estimate
Sum([Estimate])
4.2h
Avg per Task
Average([Estimate])
1h
Smallest
Min([Estimate])
12h
Largest
Max([Estimate])
03 — Rounding & Math Utilities

Round, Ceiling, Floor, Abs, Mod

Rounding

Round(3.7)        → 4
Round(3.2)        → 3
Round(3.456, 2)  → 3.46
Ceiling(3.1)     → 4  (always up)
Floor(3.9)       → 3  (always down)

Abs and Mod

Abs(-15)    → 15 (absolute value)
Mod(17, 5)  → 2  (remainder)

Abs() is useful when you want the magnitude of a difference regardless of sign. Mod() is useful for alternating row styles, weekly cycles, and pagination logic.

04 — How Dates Work

Dates are sequential numbers.

Understanding date storage is the key to unlocking date arithmetic. Coda (like most spreadsheet systems) stores every date as a sequential integer — the number of days since a fixed origin point.

The origin: December 30, 1899 = day 0 January 1, 1900 = day 2. January 1, 2025 = day 45,658. Each day is exactly 1. This means date arithmetic is just number arithmetic: EndDate - StartDate gives you the number of days between them. DueDate < Today() works because both are numbers.
Date storage — what's really happening
What you seeWhat Coda storesNotes
Dec 30, 18990Origin / epoch
Jan 1, 19002Day 2
Apr 15, 202545762Days since epoch
Apr 16, 202545763Exactly 1 more
Apr 15, 2025 12:0045762.5Noon = +0.5 days
05 — Today() and Now()

Dynamic dates that update themselves.

Two functions give you the current moment — and both recalculate automatically every time the doc is loaded or refreshed.

Today()

Returns today's date with no time component. The stored value is an integer (e.g. 45762 for Apr 15, 2025). Use this for date-only comparisons — due dates, deadlines, birthdays.

thisRow.[Due Date] < Today()
→ true if the task is overdue

Now()

Returns the current date and time. The value includes fractional days (e.g. noon = 45762.5). Use when time precision matters — log timestamps, countdown timers, hourly calculations.

Now() - thisRow.[Created At]
→ decimal days since row was created
Today() vs Now() for overdue checks Use Today() for deadline comparisons — it strips the time so a task due "today" doesn't flip to overdue until midnight. Now() would mark a task due at 9am as overdue at 9:01am.
06 — DateAdd & Date Arithmetic

Moving forward and backward in time.

DateAdd() is the workhorse for deadline calculations, scheduling, and "X days from now" logic. It takes three arguments: a starting date, a number, and a unit.

DateAdd(Today(), 7, "days")
Function DateAdd() — adds a duration to a date
Arg 1 — start date Today() — the date to start from (can be any date column)
Arg 2 — amount 7 — use negative numbers to go backward in time
Arg 3 — unit "days" — also: "weeks", "months", "years", "hours", "minutes"
DateAdd — practical examples
DateAdd(Today(), 7, "days")      → one week from now
DateAdd(Today(), 1, "months")    → same day next month
DateAdd(Today(), -30, "days")    → 30 days ago
DateAdd(thisRow.[Start], 2, "weeks") → 2 weeks after start date

Date arithmetic without DateAdd

Because dates are numbers, you can subtract two dates to get a duration in days. This is often simpler than DateAdd() for duration calculations.

// Days between two dates
thisRow.[End Date] - thisRow.[Start Date]   → number of days

// Days remaining until deadline
thisRow.[Due Date] - Today()              → positive if future, negative if overdue

// Is this task overdue?
thisRow.[Due Date] < Today()              → true / false
07 — Extracting & Formatting Dates

Day(), Month(), Year(), .format()

Sometimes you need a component of a date — just the year for grouping, or the month for a calendar view. And for display, .format() lets you control exactly how dates appear.

Extracting components

Day(Today())     → 15  (day of month)
Month(Today())   → 4   (April)
Year(Today())    → 2025
Hour(Now())     → 14  (2pm)
Minute(Now())  → 32

Custom display with .format()

Today().format("MMM D, YYYY")
→ "Apr 15, 2025"

Today().format("YYYY-MM-DD")
→ "2025-04-15" (ISO 8601)

Now().format("h:mm A")
→ "2:32 PM"
Format tokens YYYY — 4-digit year  ·  MM — 2-digit month  ·  MMM — abbreviated month name  ·  MMMM — full month name  ·  D — day without leading zero  ·  DD — day with leading zero  ·  ddd — abbreviated weekday (Mon, Tue…)
08 — Putting It Together

A real project tracker formula set.

Here's how these functions combine in a real Tasks table — four formula columns working together to give you a complete picture of project health at a glance.

Tasks — formula columns for project health
Task Due Date Date Status Select Days Left Formula Overdue Formula
Write copy Apr 10 Done
Design mockups Apr 20 In Progress 5
Send proposals Apr 8 To Do -7
Days Left column: thisRow.[Due Date] - Today()
Overdue column (Checkbox): thisRow.[Due Date] < Today() && thisRow.[Status] != "Done"

You can also build a summary block on the canvas to surface totals:

Canvas dashboard block — project health at a glance
// Total estimated hours
Sum(Tasks.[Estimate])

// Tasks due in the next 7 days
Tasks
  .Filter(
    [Due Date] >= Today() &&
    [Due Date] <= DateAdd(Today(), 7, "days")
  )
  .Count()

// Average days remaining across all open tasks
Tasks
  .Filter([Status] != "Done")
  .([Due Date] - Today())
  .Average()
  .Round(1)
Practice

Fill in the blanks.

Number & Date Formulas

5 Questions
Question 1 of 5
To add up all values in the Estimate column of the Tasks table, write: ___(Tasks.[Estimate])
Question 2 of 5
To check if a task is overdue, compare its Due Date to _____() — which returns today's date without a time component.
Question 3 of 5
To get the date one week from now: _______(Today(), 7, "days")
Question 4 of 5
Round(3.7) returns: ___
Question 5 of 5
The expression thisRow.[End Date] - thisRow.[Start Date] returns the number of ____ between the two dates.
← Prev Text Formulas Lesson 09