Calculate the difference between two times (2024)

Excel for Microsoft 365 Excel 2021 Excel 2019 Excel 2016 More...Less

Let's say that 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.

Present the result in the standard time format

There are two approaches that you can take to present the results in the standard time format (hours : minutes : seconds). You use the subtraction operator (-) to find the difference between times, and then do eitherof the following:

Apply a custom format code to the cell by doing the following:

  1. Select the cell.

  2. On the Home tab, in the Number group, click the arrow next to the General box, and then click More Number Formats.

  3. In the Format Cells dialog box, click Custom in the Category list, and then select a custom format in the Type box.

Use 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.

Example Table 1 — Present the result in the standard time format

Copy the following table to a blank worksheet, and then modify if necessary.

A

B

1

Start time

End time

2

6/9/2007 10:35 AM

6/9/2007 3:30 PM

3

Formula

Description (Result)

4

=B2-A2

Hours between two times (4). You must manually apply the custom format "h" to the cell.

5

=B2-A2

Hours and minutes between two times (4:55). You must manually apply the custom format "h:mm" to the cell.

6

=B2-A2

Hours, minutes, and seconds between two times (4:55:00). You must manually apply the custom format "h:mm:ss" to the cell.

7

=TEXT(B2-A2,"h")

Hours between two times with the cell formatted as "h" by using the TEXT function (4).

8

=TEXT(B2-A2,"h:mm")

Hours and minutes between two times with the cell formatted as "h:mm" by using the TEXT function (4:55).

9

=TEXT(B2-A2,"h:mm:ss")

Hours, minutes, and seconds between two times with the cell formatted as "h:mm:ss" by using the TEXT function (4:55:00).

Note:If you use both a format applied with the TEXT function and apply a number format to the cell, the TEXT function takes precedence over the cell formatting.

For more information about how to use these functions, see TEXT function and Display numbers as dates or times.

Example Table 2 — Present the result based on a single time unit

To do this task, you'll use the INT function, or the HOUR, MINUTE, and SECOND functions as shown in the following example.

Copy the following table to a blank worksheet, and then modify as necessary.

A

B

1

Start time

End time

2

6/9/2007 10:35 AM

6/9/2007 3:30 PM

3

Formula

Description (Result)

4

=INT((B2-A2)*24)

Total hours between two times (4)

5

=(B2-A2)*1440

Total minutes between two times (295)

6

=(B2-A2)*86400

Total seconds between two times (17700)

7

=HOUR(B2-A2)

The difference in the hours unit between two times. This value cannot exceed 24 (4).

8

=MINUTE(B2-A2)

The difference in the minutes unit between two times. This value cannot exceed 60 (55).

9

=SECOND(B2-A2)

The difference in the seconds unit between two times. This value cannot exceed 60 (0).

For more information about how to use these functions, see INT function, HOUR function, MINUTE function, and SECOND function.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Calculate the difference between two times (2024)
Top Articles
How Engineering Has Changed the World
How to find a lead investor for your fundraise
Mrh Forum
Practical Magic 123Movies
Mr Tire Prince Frederick Md 20678
His Lost Lycan Luna Chapter 5
Trade Chart Dave Richard
Www.megaredrewards.com
Mawal Gameroom Download
Whiskeytown Camera
No Credit Check Apartments In West Palm Beach Fl
Unit 1 Lesson 5 Practice Problems Answer Key
Cincinnati Bearcats roll to 66-13 win over Eastern Kentucky in season-opener
Methodist Laborworkx
4302024447
Rosemary Beach, Panama City Beach, FL Real Estate & Homes for Sale | realtor.com®
Gma Deals And Steals Today 2022
Der Megatrend Urbanisierung
Shasta County Most Wanted 2022
Curry Ford Accident Today
Ein Blutbad wie kein anderes: Evil Dead Rise ist der Horrorfilm des Jahres
Sulfur - Element information, properties and uses
Drug Test 35765N
Dark Entreaty Ffxiv
Obituaries Milwaukee Journal Sentinel
Culver's.comsummerofsmiles
Cfv Mychart
Mawal Gameroom Download
What Is Opm1 Treas 310 Deposit
25Cc To Tbsp
Homewatch Caregivers Salary
Memberweb Bw
Hypixel Skyblock Dyes
Skroch Funeral Home
Federal Student Aid
Mydocbill.com/Mr
Wattengel Funeral Home Meadow Drive
Convenient Care Palmer Ma
Ursula Creed Datasheet
How to Quickly Detect GI Stasis in Rabbits (and what to do about it) | The Bunny Lady
Sallisaw Bin Store
Bmp 202 Blue Round Pill
303-615-0055
SF bay area cars & trucks "chevrolet 50" - craigslist
Craigslist Com Brooklyn
Estes4Me Payroll
Nfl Espn Expert Picks 2023
Duffield Regional Jail Mugshots 2023
Leslie's Pool Supply Redding California
Haunted Mansion Showtimes Near The Grand 14 - Ambassador
32 Easy Recipes That Start with Frozen Berries
Latest Posts
Article information

Author: Prof. An Powlowski

Last Updated:

Views: 5687

Rating: 4.3 / 5 (44 voted)

Reviews: 83% of readers found this page helpful

Author information

Name: Prof. An Powlowski

Birthday: 1992-09-29

Address: Apt. 994 8891 Orval Hill, Brittnyburgh, AZ 41023-0398

Phone: +26417467956738

Job: District Marketing Strategist

Hobby: Embroidery, Bodybuilding, Motor sports, Amateur radio, Wood carving, Whittling, Air sports

Introduction: My name is Prof. An Powlowski, I am a charming, helpful, attractive, good, graceful, thoughtful, vast person who loves writing and wants to share my knowledge and understanding with you.