Calculate the Difference Between Two Times in Excel

Add to Favorites

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

Our Excel Courses

  • Skill Level: All Levels
  • |
  • 5 hours+

How to make a fully featured professional form in Excel that is unbreakable. This includes how to use the form to store, view, edit, and delete data from a data storage worksheet.

  • Skill Level: All Levels
  • |
  • 2 hours

Send Emails from Excel using VBA and Macros. This course starts from the Basics and builds up to more advanced examples with attaching workbooks, worksheets, PDF's, automatically sending emails, including a signature, error handling, increasing speed, and more.

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 ...
TEXTJOIN with Different Delimiters at Once in Excel
Tutorial: How to combine text using multiple different delimiters and TEXTJOIN in Excel. This is a ...
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...
Format Cells in The Number (Numerical) Number Format in Excel
Macro: This free Excel macro formats selected cells in the Number or Numerical number format in E...