Adding time across days

phil_mccomb

New Member
Joined
Jul 21, 2013
Messages
7
Hi,
I have a timekeeping spreadsheet that adds hours and minutes from start time to finish time.

This works fine if you finish before midnight, but as soon as you go past midnight it counts backwards?

Is there a way to ensure it always counts up? The formula looks like this: =IF(((E6-D6)*1440/60>5.49),(((E6-D6)*1440)/60),(((E6-D6)*1440)/60))

E6=Finish time and D6=Start time (I know the answer for both is the same, but I leave that format so I can subtract a lunch break when required)

The first line is incorrect because i want it to add hours from 09:30 on day 1 until 07:00 on day 2 (which should add up to 21.5 hrs, not -2.5 hrs)

EmployeeStart timeFinish timeTotal hours
McComb, Phil9:307:00-2.50
McComb, Phil9:3019:009.50

<tbody>
</tbody>



Thanks in advance.
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
I'm assuming total hours is in F and Finish and Start are in E and D, respectively:

Code:
=(E6-D6+(E6 < D6))*24
<d6))*24[ code]

Be sure when you enter your time you are specific about AM/PM, even if your formatting won't show the distinction.</d6))*24[>
 
Last edited:
Upvote 0
Correct, hours in F and Finish start in E and C.

When I select either the start time or finish time it states AM/PM (ie: 9:30:00 AM) so I can safely assume it knows whether it is am or pm but I just can't get it to keep counting forward past midnight
 
Upvote 0
Perfect!!! (looks simple too... ) not sure why I had to *1440/60, but it was 5 years ago so I don't remember.

THANKS
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

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