Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Calculate the Difference Between Time


Hello Dears,

Kindly need your support for attched file,

For example:

  • Start time: 8/17/2023  11:00:00 PM
  • End Time: 8/18/2023  10:00:00 AM
  • So duration is : 11:00:00

My point:

I need to exclude duration 12 AM to 8 AM from the result  (to be 3 Hours instead of 11 Hour) 

Hope my point being clear.



Did you try my Answer (suggested tutorial), Khaled?
John_Ru (rep: 6212) Aug 23, '23 at 1:00 pm
Add to Discussion



Hi Khaled

Don created an excellent tutorial on this; see Calculate Hours Worked - Day or Night Shift & Breaks in Excel. You just need to adjust the times. 

Hope this helps- if so, please remember to mark this Answer as Selected.


Answer the Question

You must create an account to use the forum. Create an Account or Login