Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Need help calculating multiple fields

Topic Labels: Formulas
239 1
cancel
Showing results for 
Search instead for 
Did you mean: 

We track time and often time there are more than one entry until we get a total. Here is what we do…

{Start Time 1} and {End Time 1} and calculation formula is DATETIME_DIFF({End Time 1},{Start Time 1},‘seconds’)
{Start Time 2} and {End Time 2} and calculation formula is DATETIME_DIFF({End Time 2},{Start Time 2},‘seconds’)
{Start Time 3} and {End Time 3} and calculation formula is DATETIME_DIFF({End Time 3},{Start Time 3},‘seconds’)

Then I have a Total Calculation formula Field: {Calculation 1} + {Calculation 2} + {Calculation 3}

The problem is if one of the calculation fields is empty the Total Calculation field just show “NaN”.

I would love any advice on how to solve this or a better way to calculate overall.

1 Reply 1

I think I got it…

DATETIME_DIFF({End Time 1},{Start Time 1},‘seconds’)
IF(NOT({End Time 2} = “”), DATETIME_DIFF({End Time 2},{Start Time 2},‘seconds’), BLANK())
IF(NOT({End Time 3} = “”), DATETIME_DIFF({End Time 3},{Start Time 3},‘seconds’), BLANK())