negative time recalculation

bartvdg

Board Regular
Joined
Sep 27, 2009
Messages
65
inputinputformula (arrived on site - driving time)
DRIVING TIMEARRIVED ON SITESTARTED DRIVING
1:0015:0014:00
3:0019:3016:30
18:003:00gives negative number ########
- should be 9:00

<tbody>
</tbody>

Who can help me solving above?
I calculate the 'started driving time" by subtracting arrival time from driving time.
When negative i don't know how to calculate for correct time?
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Date is an integer formatted as a date where
1 = 1 Jan 1900
2 = 2 Jan 1900
43591 = 6 May 2019

Time is a decimal between 0 and 1
0.25 = 6 am
.5 = 12 noon
.75 = 6 pm
0.99653 = 11.55 pm
etc

Time differences
A combination of date and time is required to deal with any situation that may arise
43591.25 = 6pm on 6 May 2109 etc
43592.75 = 6am on 7 May 2109 etc
The difference is .5 = 12 hours

Possible simple workaround
If the total time NEVER exceeds 24 hours, a simple workaround is to amend the formula to add 1 to the number if negative

<a1)*1< html=""></a1)*1<>
 
Last edited:
Upvote 0
I intended to post the worksheet to illustrate
Here it is ...

Excel 2016 (Windows) 32 bit
A
B
C
D
1
DriveArriveDriving time formula
2
01:00​
15:00​
14:00​
=(B2-A2)+1*(B2 < A2)
3
03:00​
19:30​
16:30​
=(B3-A3)+1*(B3 < A3)
4
18:00​
03:00​
09:00​
=(B4-A4)+1*(B4 < A4)
Sheet: Sheet1
 
Last edited:
Upvote 0
Another option (again assuming difference between times will not be greater than 24 hrs.).
Copy formula down as needed.
Excel Workbook
ABCD
1DriveArriveDriving timeformula
21:0015:0014:0014:00
33:0019:3016:3016:30
418:003:009:009:00
Sheet
 
Upvote 0

Forum statistics

Threads
1,214,983
Messages
6,122,583
Members
449,089
Latest member
Motoracer88

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