But the problem is with the 0 to 24 format. When I have, for example, to calculate the difference between "02:04" and "19:00", I would like to have "07:04" but I have "00:00:00" (in yellow). In the next line in the image, the result is ok.

But the problem is with the 0 to 24 format. When I have, for example, to calculate the difference between "02:04" and "19:00", I would like to have "07:04" but I have "00:00:00" (in yellow). In the next line in the image, the result is ok.

It's because I'm working only with time, I'm not using date. So, I don't know if it's possible to get the result that I want only with the time information.

But the problem is with the 0 to 24 format. When I have, for example, to calculate the difference between "02:04" and "19:00", I would like to have "07:04" but I have "00:00:00" (in yellow). In the next line in the image, the result is ok.

It's because I'm working only with time, I'm not using date. So, I don't know if it's possible to get the result that I want only with the time information.

No, It is happening,because it will return negitive value and negitive value not divided thats why you geeting

00:00:00.

Can do one thing check diff is Negitive or positve if diff is positive go as same flow it is working

and negitive flow first multiply by - sign it will convet as positive value and do your calution and after calculation is complete show - sign before hours,

It is possible, as far as you know the day that you want to compare. In this particular situation, it seems that you want to compare always with the previous day, so you can do it.

First thing, you need to verify if the second time is greater than the first one. If it is, you apply the math that you have right now:

T2 = 20:47

T1 = 17:40

T1 <= T2

Result = T2 - T1 = 20:47 - 17:40 = 03:07

Second, if the second time is smaller (less) than the first one, you need to do the math to compare to that time from the previous day.

T2 = 02:04

T1 = 19:00

T1 > T2

You just need to create a new time with 23:59 value and subtract the T1 value to it.

23:59 - 19:00 = 04:59

Then you add the T2 value to the result, plus 1 minute.

04:59 + 00:01 + 02:04 = 05:00 + 02:04 = 07:04

This will allow you to get the result that you want.

It is possible, as far as you know the day that you want to compare. In this particular situation, it seems that you want to compare always with the previous day, so you can do it.

First thing, you need to verify if the second time is greater than the first one. If it is, you apply the math that you have right now:

T2 = 20:47

T1 = 17:40

T1 <= T2

Result = T2 - T1 = 20:47 - 17:40 = 03:07

Second, if the second time is smaller (less) than the first one, you need to do the math to compare to that time from the previous day.

T2 = 02:04

T1 = 19:00

T1 > T2

You just need to create a new time with 23:59 value and subtract the T1 value to it.

23:59 - 19:00 = 04:59

Then you add the T2 value to the result, plus 1 minute.

04:59 + 00:01 + 02:04 = 05:00 + 02:04 = 07:04

This will allow you to get the result that you want.

Kind regards,

Rui Barradas

Hi ! Thank you for your answer. It almost allow me to get the result that I want.

If I have, for example,

T2 = 18:00

T1 = 19:00

Then, T1 > T2. And if I use the logic of substract 23:59, I will not get 01 hour.