You are on page 1of 2

Calculate the difference between two times - Excel - Office.

com

http://office.microsoft.com/en-001/excel-help/calculate-the-difference-...

Let's say you want find out how long it takes for an employee to complete an assembly line operation or a fast food order to be processed at peak hours. There are several ways to calculate the difference between two times.

Show All

Present the result in the standard time format (hours : minutes : seconds) Present the result in a total based on one time unit (120 minutes)

There are two approaches that you can take to present the results in the standard time format. You can use the subtraction operator (-) to find the difference between times and: A custom format code in the cell. The TEXT function to format the times. When you use the time format codes, hours never exceed 24, minutes never exceed 60, and seconds never exceed 60.

The example may be easier to understand if you copy it to a blank worksheet. How to copy an example A 1 2 Start time 6/9/2007 10:35 AM Formula =B2-A2 =B2-A2 =B2-A2 =TEXT(B2-A2,"h") =TEXT(B2-A2,"h:mm") =TEXT(B2A2,"h:mm:ss") B End time 6/9/2007 3:30 PM Description (Result) Hours between two times with the cell formatted as "h" (4) Hours and minutes between two times with the cell formatted as "h:mm" (4:55) Hours, minutes, and seconds between two times with the cell formatted as "h:mm:ss" (4:55:00) Hours between two times (4) Hours and minutes between two times (4:55) Hours, minutes, and seconds between two times (4:55:00)

The previous example shows two ways to calculate the difference between two times. You can use: A simple subtraction formula, and then format the result by selecting the Custom category and entering the

1 of 2

23/05/2013 4:26 PM

Calculate the difference between two times - Excel - Office.com

http://office.microsoft.com/en-001/excel-help/calculate-the-difference-...

appropriate format code in the Type box under the Number tab of the Format Cells dialog box. The TEXT function which has a formatting argument.
NOTE If you use both a format applied with the TEXT function and number format, the TEXT function takes precedence.

TEXT Number format codes Display numbers as dates or times

To do this task, use the INT function, or HOUR, MINUTE, and SECOND functions.

The example may be easier to understand if you copy it to a blank worksheet. How to copy an example A 1 2 Start time 6/9/2007 10:35 AM Formula =INT((B2-A2)*24) =(B2-A2)*1440 =(B2-A2)*86400 =HOUR(B2-A2) =MINUTE(B2-A2) =SECOND(B2-A2) B End time 6/10/2007 3:30 PM Description (Result) Total hours between two times (28) Total minutes between two times (1735) Total seconds between two times (104100) Hours between two times, when the difference does not exceed 24. (4) Minutes between two times, when the difference does not exceed 60. (55) Seconds between two times, when the difference does not exceed 60. (0)

INT HOUR MINUTE SECOND

Site Directory

Contact Us

Submit Feedback

Legal

Trademarks

Privacy and Cookies

Accessibility

2 of 2

23/05/2013 4:26 PM

You might also like