Calculating and displaying negative time

cheap_ash

Board Regular
Joined
Apr 20, 2005
Messages
81
I need a formula to calcuate A2-B2 (both time/date fields) and if A2 is larger than B2, show the value as a negative. ie, if the result of A2-B2 is negative 21 hours, i need it to display - 0 21:00:00 (i'm using the d hh:mm:ss format on the output field)

I've tried concatenating "-" with an ABS calculation but I only get a serial answer back. I also tried using TIMEVALUE, but to no avail. I'm pretty stuck on this.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
one problem, what should be displayed as -0 4:09 is showing up as -1 4:09 (for 10/23/2006 22:00 - 10/23/2006 17:51) any ideas?
 
Upvote 0
I am using 1900 date system in this:
Code:
=IF(A2<B2,TEXT(B2-A2,"-hh:mm:ss"),A2-B2)
 
Upvote 0
Sorry, try this:

Code:
=IF(F2<E2,TEXT(E2-F2,"-d hh:mm:ss"),F2-E2)

Format cell as d hh:mm:ss
 
Upvote 0
is that outputting "-1 04:09:00" for you? b/c it's not -1 day, it's only -04:09:00 and it keeps telling me -1 day... thank you for trying everyone, btw, i don't mean to sound like an ingrate, just a very cranky/low sleep person right now :P
 
Upvote 0
No. it didn't.

My formula is in G3 (highlighted yellow):
Book1
ABCDEFG
1NameL.K. DATE/TIMESpawn Time DaysDowntimeN.S. DATE/TIMEActual SpawnDifference
2MO10/14/2006 19:009310/23/2006 22:0010/23/2006 17:51-01 04:09
33P10/21/2006 12:457210/28/2006 14:4510/27/2006 10:45-0 04:09:00
4Matron10/17/2006 22:009310/27/2006 1:0010/27/2006 1:0001 00:00
Sheet1
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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