Help

Multiply a number field by a number and get a duration?

1977 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Education_Team
6 - Interface Innovator
6 - Interface Innovator

Hi there!

I am trying to figure out the best way to calculate how much time my department spends in classrooms teaching programs. The length per lesson (1 hour) and the number of lessons (6 lessons) in our series is always the same, but we have a different number of classrooms that we teach in per school. I have a number field with the number of classes that we’re teaching at that school and I was hoping to have a formula field where I multiply the number of classes by the 6 lessons and translate the result into a duration. However, when I do that, even with the format for the formula as a duration, I just get “0:00” as the result. Any ideas if there is a way to multiply a number by a duration and get a duration result?

Thanks so much!

4 Replies 4
bdelanghe
7 - App Architect
7 - App Architect

Hi!

If I understand you correctly you are teaching six 1hr lessons at multiple schools (each with a different number of classrooms? If that’s the case, I created a mockup:

Teaching Base.png

The formula field just multiplies across the row:

total hrs formula.png

It looks like you may have a blank field in your formula that is being treated as a 0.

Let me know if I’m understanding you incorrectly. If you could send a screenshot of a mockup that’d be helpful.

[edited to fix images]

Education_Team
6 - Interface Innovator
6 - Interface Innovator

That’s essentially it!

I was hoping to find a way to not have to enter that there are 6 lessons at a 1 hour duration every time I make a new record, since it’s the same for every school, so was trying to see if it was possible just to have the # of classes as a field in my table and have the duration built into the formula.

What I tried to do, but seem to not be possible, is multiply the # of classrooms by 6 and asked AIrtable to format the result as a duration - but since there isn’t a duration in the formula it just resulted in 0:00.

1

2

Actually, your problem is just that Airtable interprets “durations” as “seconds” on the backend. Your formula is multiplying 6*number of classrooms - let’s say it’s 5 - resulting in the value 30 as output.

When you tell it to display the value as a “duration”, it takes the value 30 and displays it as 30 seconds in the field. You have the formatting set to cut off the seconds, and only show accuracy to the minute, so the result is 0 minutes (0:00).

What you need to do is multiply the output by the the number of seconds it should represent - 3600. Then, your “Duration” output will show what you are wanting.

Aha, that makes so much sense! Everything is exactly right now. Thank you so much!