Skip to main content

Need help calculating multiple fields

  • February 28, 2021
  • 1 reply
  • 0 views

Forum|alt.badge.img+2

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

Forum|alt.badge.img+2
  • Author
  • Known Participant
  • 13 replies
  • March 1, 2021

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())


Reply