# How to calculate time difference between two times in MS Excel

To calculate difference between two times first important thing is that time should be in proper format. Correct format will be mm/dd/yyyy  hh:mm. This Guide provides methods to calculate difference in Seconds or Minutes or Hours or hh:mm (hours and minutes format).

## Calculate Time difference between two times

Excel can calculate difference between two time in hour or minutes or seconds. Out of several method to calculate time difference easiest method is to subtract one time from other.

The formula for it is

`= Second time -  First time` The difference is a number because all times are stores in excel as numbers. Now you will have to convert these number to time. This can be done simply by changing format of this number by right clicking on number and select Format cell and select/create custom format

• h:mm to see difference in hours and minutes
• h see difference in hours
• h:mm:ss to see difference in hours, minutes and seconds ## Calculate Time difference in Hours

In order to calculate time difference in hours between two timings use following formula in excel

`=INT((Second time -  First time)*24)`

## Calculate Time difference in Minutes

To find time difference in minutes between two timings use formula

=(Second time –  First time)*1440

## Calculate Time difference in Seconds

To find time difference in hours between two timings

=(Second time –  First time)*86400

## Example calculate time difference between two times

Our Example Chart shows train departure timings ## Calculate Time difference between two times in hh:mm format

To get this difference in Standard time (hh:mm) format you will have to follow different method

To calculate Time difference between two times in format h (hours) between two timings

=TEXT(Second time –  First time,”h”)

To calculate Time difference between two times in format hh:mm (Hours and minutes) between two timings

=TEXT(Second time –  First time,”h:mm”) Mention your timings in correct format (Click on the link to know more about time format) to get desired results else you might end up with wrong results.

Calculate time difference if one of the timings is beyond 12 AM ( Click on link)