Calculate the Difference Between Two Times in Excel

Add to Favorites
Author:

Here, youll learn how to get the difference between two times in Excel.

A common example of this is for when someone starts and finishes work.

(Note that my version of Excel put the finish time in the 24 hour time format (military time) but that it is still just 5:45 PM.)

Here we have a start and finish time and I want to see how much time has elapsed between them.

All you need to do is to subtract the starting time from the finish time:

Excel will generally handle the rest.

However, if the display of the new time does not look correct, it should be 7:45 in this case, then we need to make sure the formatting is right.

Right-click the Time cell and select the Format Cells option.

From there, a window will open up that looks like this:

Go to the Number tab and then select Custom from the Category section and make sure that you have selected h:mm from the area on the right.  Then, hit OK and everything should work as you expect.

Return the Hours, Minutes, or Seconds from the Time Difference in Excel

You can also return just the Hours, Minutes, or Seconds from this result by using three simple functions, the HOUR(), MINUTE(), and SECOND() function. 

NOTE, these functions in the examples below will not return the total minutes or seconds between two times but will simply break that portion of the time out of the original result.

Here are the three functions:

Here are the results of these functions:

You can see how the total Time is 7 hours and 45 minutes and 0 seconds from cell C2, so these elements are simply broken out into their own cell using the Hour, Minute, and Second functions above.

Time is a very confusing element of Excel, but it can be quite powerful once you get to learn it a bit more.

This tutorial should help provide the foundation for more complex calculations and I urge you to browse the Date and Time Tutorial section on this site for more help.

Dont forget to download the spreadsheet used in this tutorial so you can follow along with it.

 


Excel Function: HOUR(), MINUTE(), SECOND()
Downloadable Files: Excel File

Question? Ask it in our Excel Forum


Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 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

Similar Content on TeachExcel
Calculate the Difference Between Time Greater than 24 Hours in Excel
Tutorial: Ill show you how to calculate the difference between two times in Excel when that differe...
Get the Number of Workdays Between Two Dates in Excel
Tutorial: How to calculate the total number of working days between two dates in Excel.  This allow...
Years, Months, Days Between two dates in Excel
Tutorial: I have found a rather convoluted method to Calculate the Number of Years, Months and Days ...
Get the Days, Months, & Years Between Dates in Excel (1 Formula)
Tutorial: How to output the difference between two dates, showing the days, months, and years betwe...
Vlookup on Dates and Times in Excel
Tutorial: Perform a lookup on dates and times in Excel: vlookup, hlookup, index/match, any kind of l...
TEXTJOIN with Different Delimiters at Once in Excel
Tutorial: How to combine text using multiple different delimiters and TEXTJOIN in Excel. This is a ...
Tutorial Details
Excel Function: HOUR(), MINUTE(), SECOND()
Downloadable Files: Excel File
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