Time calulations

Hydro

New Member
Joined
Dec 16, 2017
Messages
2
I am trying to compute the downtime and have a formula that subtracts the on task time, transit and wait time from 24 hours. However if the sum of the calculation equals 24 hours then I get #####s in the cell; if it equals 00:00:01 then it will display correctly ie 00:00. Is there a way of showing zero downtime as 00:00 when the calculation returns a value of 00:00:00. I have tried different formats of the results cell (hh;mm and [h]:mm) but it makes no difference.
Help appreciated
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
if the sum of the calculation equals 24 hours then I get #####s in the cell; if it equals 00:00:01 then it will display correctly ie 00:00. Is there a way of showing zero downtime as 00:00 when the calculation returns a value of 00:00:00.

It is difficult to say for sure without a concrete example that demonstrates the problem.

I suspect the problem is the result of anomalies with 64-bit binary floating-point values, which is how Excel represents numbers internally, including time. The result of your time arithmetic might be infinitesimally less than zero. To confirm, temporarily format the cell as Scientific. You might see a result of the form -1.23E-14.

To avoid this, if your time formula is of the form =expression, change it to:

=ROUND((expression)*86400,0)/86400

formatted as Custom [h]:mm . That rounds to the second.
 
Upvote 0
Hi

many thanks for the reply. I tested as requested and got -8.9E13. used the round function and it no displays correctly ie 00:00.

much appreciated:)
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top