Sum of a column in Minutes or Hours | not Days

Continuing the discussion from Launched: Redesigned Table Visuals and Interactions:

“Can the sum show just minutes and not change to houres?” - @Kristijan_Moser

There is no existing setting to change the sum at the bottom of a column to minutes. But it can be accomplished nearby

Step 1

  1. Create a table named “Test Table”
  2. Create a column inside the “Test Table” that is a Date → Duration → Minutes
  3. Name the column inside the “Test Table” as “Minutes”

:point_down:

Step 2

  1. Anywhere outside the table (on the blank canvass) press “=”
  2. Create an Unnamed Formula to only display hours (or minutes)

:point_down:

  • Round(ToMinutes([Test Table].Minutes.Sum()),1) + ’ minutes’
  • Round(ToHours([Test Table].Minutes.Sum()),1) + ’ hours’

further reading (click to expand)

(2018-05-23) https://community.coda.io/t/duration-in-hours-not-days/926 - Mallika, Duration in hours - not days

Or just use FormatDuration(), which looks safe to me (documented and with adequate parameter spec.)

ezgif.com-optimize (85)

I understand it’s a hidden formula, but I’d use it any day over the toMinutes/Round/string manipulations. Because keeping the Duration value type and leveraging existing functionality is overall a better approach than doing the calculations and type conversions yourself.


P.S. If you want to format 2 hours 30 minutes as 2.5 hours, yes, then you’ll have to convert that to a number and append “hour”/“hours” yourself.

6 Likes

Just out of curiousity @Paul_Danyliuk , where can I find documentation about FormatDuration()?

Hi @Bjorn_Hansell ,
being an experimental/hidden formula, there is no official documentation, you just have to so some tests with different parameters.

As a matter of fact, you should be aware that this might be discontinued.

I’d say that FormatDuration() can be considered safer than other hidden formulas, but it’s just a personal feeling and I’m sure no Codan would confirm this.

6 Likes