How can I add up and divide rows?

Hi, I’m new to Coda. Is there a formula for adding up rows?

I have an output table with different projects (A,B,C) and I want to add the budget for each project. I want to do the same with the working hours. Then I want to display in another table only the total added budget and the total added hours and divide the budget by the hours.

Do you know how to do that?

Cheers
Patricia

Hi Patricia,

Welcome to Coda! Apologies for the quick answer, Little busy at the moment.

I would suggest one table, with different views.

On the drop down or the columns, there is an option to sum the column, activate that. Coda will automatically give you subtotal for each grouping in your table.

Then create views grouped to the level of detail that you want to see.

Regards
Piet

1 Like

Hey Piet,

thanks for your answer! I activated the option to sum the columns but I don’t know how to create views now. Could you tell me how to do that?

Regards
Patricia

Hi @Patricia_Da_Costa :blush:

This might help you with creating views :blush:

As for your original question, you could also use a Lookup field for your Project column in your Example Table (instead of a Text field), going from your table Table to your Example table :blush: . For each task, you’ll now need to select a Project.

In your Table table, you can then add the referenced by part of the Lookup field and use those references to calculate what you wish in your Table table :blush:

In other words, now that each task is linked to a project, you can retrieve, in your second table, which tasks (from your first table) are tied to Project x within another Lookup field (going from your first table to the second one this time) which Coda can easily create for you :blush: … And then, you using this new field, you can calculate the diverse totals needed in your second table using formulas such as these :

Formula in [Budget Total]

thisRow.Task.Budget.Sum()

Formula in [Duration Total (hrs)]

thisRow.Task.Duration.Sum().ToHours()

Formula in [Budget / Duration (hrs)]

thisRow.[Budget Total]/thisRow.[Duration Total (hrs)]

I’m a little bit short on time, but I hope this helps :blush:

2 Likes

Hi @Pch,

thank you so much – I think it worked!! Amazing. :slight_smile:

Have a nice evening!

Cheers
Patricia

No problem @Patricia_Da_Costa :blush: !

Have a nice evening too :grin: !