displaying negative time

Met Fan

Board Regular
Joined
Jul 1, 2004
Messages
185
if I have expected hours of 45:00 and actual hours of 42:00 how can I display the result of their difference being 2:00 hours?

I can do a simple formula when the result is positive but not when it is negative.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
This is going to be difficult, for two reasons.

First, the difference is not 2 hours, it's 3 hours ;)

Second, Excel struggles with negative time.
If you just want to display a negative result, and are not going to use that result for any other calculation, you could do something like this
Code:
=(A1-A2)*24
and format the result as number, with 2 decimal places, to show -3.00.

BUT, if you start having fractions of hours, such as 3h 30m, this would show as -3.50, not -3.30.
There are ways round this, but it gets complicated.

Perhaps the best solution is to use something like
Code:
=max(a1,a2)-min(a1,a2)
You could then have another formula which displays a message if the max and min are not the normally expected way round.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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