Arithmetic, Sum, Round, DateAdd, Today(), Now() — compute deadlines, track durations, build live dashboards that update themselves every day.
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.
| Operator | Meaning | Example | Result |
|---|---|---|---|
+ | Addition | 8 + 3 | 11 |
- | Subtraction | 8 - 3 | 5 |
* | Multiplication | 8 * 3 | 24 |
/ | Division | 8 / 3 | 2.667 |
^ | Power / exponent | 2 ^ 8 | 256 |
2 + 3 * 4 → 14, not 20. Add parentheses: (2 + 3) * 4 → 20.
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.
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.
Sum(Tasks.[Estimate]) → total of all Estimate values Average(Tasks.[Estimate]) → mean estimate Min(Tasks.[Estimate]) → smallest estimate Max(Tasks.[Estimate]) → largest estimate
Tasks .Filter([Status] = "Done") .[Estimate] .Sum() → total hours in completed tasks only
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(-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.
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.
EndDate - StartDate gives you the number of days between them. DueDate < Today() works because both are numbers.
| What you see | What Coda stores | Notes |
|---|---|---|
| Dec 30, 1899 | 0 | Origin / epoch |
| Jan 1, 1900 | 2 | Day 2 |
| Apr 15, 2025 | 45762 | Days since epoch |
| Apr 16, 2025 | 45763 | Exactly 1 more |
| Apr 15, 2025 12:00 | 45762.5 | Noon = +0.5 days |
Two functions give you the current moment — and both recalculate automatically every time the doc is loaded or refreshed.
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
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() 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.
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() — adds a duration to a date
Today() — the date to start from (can be any date column)
7 — use negative numbers to go backward in time
"days" — also: "weeks", "months", "years", "hours", "minutes"
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
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
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.
Day(Today()) → 15 (day of month) Month(Today()) → 4 (April) Year(Today()) → 2025 Hour(Now()) → 14 (2pm) Minute(Now()) → 32
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"
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…)
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.
| 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 | ☑ |
thisRow.[Due Date] - Today()
thisRow.[Due Date] < Today() && thisRow.[Status] != "Done"
You can also build a summary block on the canvas to surface totals:
// 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)