Time formula (difference of predicted and actual time)

D

deb

I have a time formula in my spreedsheet. It is to calculate the difference
in a predicted time with the actual time. Time is entered as text eg. 14:00.
My formula is
=TEXT(A4-H4,"H:MM") OR
=TEXT(predicted time - actual time, "H:MM")

The formula works great if the actual time is prior to or equal to the
predicted time. However I cannot get a result for the time if the actual
time is later than the predicted time. I need the result to be -h,mm. If
you can help me accomplish this I would really appriceate it. Thank you
 
D

David Biddulph

If the answer should be -3 hours, your formula gives -21 hours, Bob.

Perhaps try
=IF(H4>A4,"-","")&TEXT(ABS(A4-H4),"H:MM")
 
D

deb

Thanks David, this works great for the late times but now it does not show
early times properly do you know what to do so that it will work either way.
Thanks again
 
D

deb

I am so sorry my mistake. I'm not sure what I did wrong, but I reworked it
and the formula you provided worked perfect. Thank you so much
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top