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! :slight_smile:

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! :slight_smile:

Once you understand these 2 tricks, you’ll be able to work with durations & duration formulas all day long! :wink:

1 Like

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