Difference between hours

mtagliaferri

Board Regular
Joined
Oct 27, 2004
Messages
156
Hello, I need to have the result also as negative on a date system set as 1900, for the difference between times, example 12:35 - 13:05 will return me a error, but I need to show a result as - 0:30 as weel as 13:05 - 12:35 as a result of 0:30
Is it possible?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Excel doesn't like negative times.

If you're just interested in the cosmetics (and won't be trying to add the values later), try:

Code:
=IF(A1<B1,"-","")&TEXT(ABS(A1-B1),"h:mm")
 
Upvote 0
Interesting... though Excel does not like to format negative times, it seems to be ok with their values. So you can sum them and then apply Matt's logic again...<ul>[*]=IF(SUM(C1:C5) < 0,"-","") & TEXT(ABS(SUM(C1:C5)),"[hh]:mm")[/list]<sup>edit</sup> Note: C1:C5 are actual differences: A1-B1, not Matt's formula. So this would be like in a hidden "helper" column. <sub>/edit</sub>
 
Upvote 0

Forum statistics

Threads
1,214,553
Messages
6,120,182
Members
448,948
Latest member
spamiki

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