Sundry tips - Responses to Community Questions

WIP Differences between rows

I am in the process of updating this to reflect the comments from Joost Mineur in the Community Forum.

Calculating the differences between rows in Coda can be tricky, for the following reasons:
The row sequence is not static, like it is in Excel. For a full discussion of row sequence, see
Formulas are valid for all rows in a column. Which means that if your formula is “difference = this row - previous row”, you are going to need additional logic to handle the case of the first row in your table.
Individual “cells” in Coda cannot be used in formulas like in Excel. The smallest unit to directly work with in Coda is a row.
Some further background - Table Order vs Sort Order vs Entry Order

But there are ways around this.
There is a special column type called RowID, see below. This stores a sequential number, generated as new rows are created. This number is unique. Even if a row is deleted, that number will not be used again.
You can then build a slightly more complex formula, which includes an If(), so that when the RowID=1, then Difference = 0, Else thisrow-previousrow.
Differences between Rows
0
Search
Sequence
Difference
Tickets
1
1
0
11
2
2
11
22
3
3
14
36
4
4
4
40
5
5
-2
38
There are no rows in this table

The formula in the Difference column looks like this:
image.png
Sequential entries
0
Search
Sequential numbers
Row ID
Column 3
1
10
1
2
15
4
3
20
2
4
30
3
5
5
There are no rows in this table
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.