Time Tracker Block - Calculate Billable Time

I created a time tracker block to track time and wish to create a billable time calculated field that will calculate the duration and set to 30 minutes if the duration is less 30 minutes. something like:

IF( duration is less than 30 minutes, set "Billable Time Value to 30 minutes, Otherwise set to Current Duration).

Iâ€™m assuming I need to create a field called â€śBillable Timeâ€ť as a calculated field, I just need help with the logic.

Duration Field is set to type: Duration

Welcome to the community, @David_Derby!

There are 2 different Airtable tricks to know about, in order to understand how to work with durations:

Duration trick #1:

The first trick to understanding the duration field is that Airtable only understands duration in â€śsecondsâ€ť, not â€śminutesâ€ť or â€śhoursâ€ť.

So even if Airtable is visually showing you â€śminutesâ€ť or â€śhoursâ€ť on the screen, Airtable is still calculating the duration in â€śsecondsâ€ť behind-the-scenes.

So, 30 minutes is equal to 1800 seconds, so you would use that 1800 number in your formula.

Your formula would then look something like this:

Billable Time =
`IF({Duration Field}<1800,1800,{Duration Field})`

Duration trick #2:

However, once you save that formula, youâ€™ll notice that Airtable only shows you the resulting number in â€śsecondsâ€ť in your field!

So, the second trick is that you need to format your formula field as a duration.

Go back into your formula, and click on the â€śFormattingâ€ť tab. There, you will see an option to format your number as a duration.

And thatâ€™s it!

Once you understand these 2 tricks, youâ€™ll be able to work with durations & duration formulas all day long!

2 Likes

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.