May 15, 2020 08:29 AM
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
Solved! Go to Solution.
May 17, 2020 09:41 AM
Welcome to the community, @David_Derby! :slightly_smiling_face:
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! :slightly_smiling_face:
Once you understand these 2 tricks, you’ll be able to work with durations & duration formulas all day long! :winking_face:
May 17, 2020 09:41 AM
Welcome to the community, @David_Derby! :slightly_smiling_face:
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! :slightly_smiling_face:
Once you understand these 2 tricks, you’ll be able to work with durations & duration formulas all day long! :winking_face: