A column with different formulas

Hi there,
when I set a formula, the formula is applied to all rows of the column.
Is there a way to put different formula per cell?

For example,

| Monday | a + b |
| Tuesday | c + d |
| Wednesday | e + f |

So far I haven’t found a way.


IF it’s not possible with coda,
I was thinking… I could just make variables,

Monday = a + b
Tuesday = c + d
Wednesday = e + f

but, when I want to get the values dynamically,
for example, let’s say there is a table with “day” column, and for the second column I want to get the values from the variables,

is there a way to set a formula for the second column like the following?

= getValueFromVariableName(thisRow.day)

like eval function in JS.


Hope to get some insights here.
Thanks.

There’s no way to eval, there’s no “reflection” in Coda. But your original idea is in fact right. To have different calculations you’ll need to use SwitchIf()/Switch(), e.g.

Day.Switch(
  "Monday", ColumnA + ColumnB,
  "Tuesday", ColumnC + ColumnD,
  ...
)

It’s still one formula for each row in the column, but you can have conditionals there.

2 Likes

Hi @Eunjae_Lee1,

Here’s a great blog article on why Coda uses tables and not spreadsheets, if you’re curious…

1 Like

Ah that’s an idea. Anyway I need to manually map all the formulas per day and I could do it in switch syntax and use the formula in a column.
Nice approach! Thanks :blush:

Thanks. I’ll give it a read :slightly_smiling_face: