Divide a duration value in half

Hi,

I'm trying to divide a duration value in half. For example "000:02:48" should read "000:01:24".

I have played around with changing the value to a decimal first and then dividing but I also have a problem converting the decimal value back to duration.

Any help in this matter would be appreciated!

0 3 208
3 REPLIES 3

The approach would be to:

  1. convert to hours using the TOTALHOURS() function
  2. divide by 2
  3. convert back to a Duration.  This part that is not supported directly but there is a handy expression for doing just that in the TIME() support article.  Look for the sub-title "Duration from Decimal Hours"

I hope this helps!

Where does that duration value comes from btw? You may be able to cut in half before the duration is generated, if you are calculating it from somewhere else

Appsheet sucks at advanced duration math. It shouldn't, because it's very easy in a spreadsheet, like literally take the duration and divide by 2 and you're done. I don't know why they programmed it so differently. 

To solve this with an Appsheet expression, convert the duration to TOTALSECONDS(), then divide it by 2, then manually build those seconds back into a duration string with something like [new-duration]/(60*60) & ":" & MOD([new-duration],60*60)/60 & ":" & MOD([new_duration],60)

Top Labels in this Space