ExcelCSE.com

Menu
  • Excel 101
  • Excel Functions
  • Excel Formula
  • Contact Us
How to Use Excel > Excel Formula > How to Calculate Time Difference in Excel

How to Calculate Time Difference in Excel

How many hours, minutes and seconds between two times?
Table of contents :
  • How many hours between two times?
  • How many minutes between two times?
  • How many seconds between two times?
  • How many hours, minutes and seconds between two times?
  • How many days, hours, minutes and seconds between two times?

How to calculate time difference in excel

How many hours between two times?

To get hours between two times, use the subtraction formula.

How many hours between two times

A result is a decimal number (You might get a different result if you have a different format cell). The numbers are in a day unit, to get the numbers in hour multiply the results by 24.

The formula

=(B2-A2)*24

The result

How many hours between two times

If the result is less than 1, then the difference between two times is less than 1 hour.

How many minutes between two times?

It’s like looking for hours between two times. To get minutes between the two times, use the subtraction formula, but multiply the result by 1440. Where did the number 1440 come from? The number comes from the multiplication of numbers 24 and 60.

The formula

=(B2-A2)*1440

The result

How many minutes between two times

How many seconds between two times?

To get seconds between two times, use the subtraction formula and multiply the result by 86400.

The formula

=(B2-A2)*86400

The result

How many seconds between two times

All results are integer number because seconds are the smallest units in time.

How many hours, minutes and seconds between two times?

The three formulas above only return numbers in one unit, hours only, minutes only or seconds only. How to get the complete difference in hours, minutes and seconds?

Solution 1: Subtraction formula and format cell

Subtraction formula is the easiest solution, requires only one subtraction formula. The result will be a decimal number like the first picture above. To get the difference in details, do a format cell with the “h:mm:ss” format.

The result

Time between two dates

Solution 2: HOUR, MINUTE and SECOND Function

The result of solution 1, all the differences are in one column. If you want the difference in hours to be in its column as well as the difference in minutes and seconds, the solution is using HOUR, MINUTE and SECOND function.

The formula for hours column

=HOUR(B2-A2)

The formula for minutes column

=MINUTE(B2-A2)

The formula for seconds column

=SECOND(B2-A2)

The result

Calculate time between dates

How many days, hours, minutes and seconds between two times?

What if the difference in time is more than one day, how to calculate it? Use the subtraction formula.

The formula

=B2-A2

The result

How to subtract time in excel

The number in front of the decimal separator is the difference in days, while the number behind the decimal separator is the difference in hours, minutes and seconds.

For more informative, you can separate the difference in days, hours, minutes and seconds in each column. You need the QUOTIENT and MOD function to separate integer numbers and decimal numbers.

The integer number is the difference in days, and the decimal number is the difference in hours, minutes and seconds. You need the HOUR, MINUTE and SECOND functions to extract the details.

The formula for days column

=QUOTIENT(B2-A2,1)

The formula for hours column

=HOUR(MOD(B2-A2,1))

The formula for minutes column

=MINUTE(MOD(B2-A2,1))

The formula for seconds column

=SECOND(MOD(B2-A2,1))

The result

How to calculate time in excel

The difference in days is more than 30 days, and some are more than 365 days. Read the following article to find out how to calculate the difference in years, months, weeks and days between two dates

  • Calculate number of days, weeks, months and year between two dates

Related Function

Function used in this article
  • Excel HOUR Function
  • Excel MINUTE Function
  • Excel SECOND Function
  • Excel QUOTIENT Function
  • Excel MOD Function
Usefull links
  • Microsoft Excel Calculate the Different between Two Times documentation
Share
Tweet
Google+
Email
Prev Article
Next Article

Related Articles

VLOOKUP MATCH
VLOOKUP MATCH – Solution for VLOOKUP REF Error The article …

VLOOKUP MATCH – a Combination for a Solution

SUMIFS Limitations and Solutions
“How to Use the Excel SUMIFS Function” article explains SUMIFS …

SUMIFS Limitations and Solutions

Excel Divide by Zero
Pay attention to the data below. A store sells five …

Excel Divide by Zero Error

How to Separate Date and Time in Excel
The date and time value can be written in one …

How to Separate Date and Time in Excel

How to Merge Cells in Excel without Losing Data
To merge two cells or more without losing data, you …

How to Merge Cells in Excel without Losing Data

Tags:Calculate Time Between Dates HOUR Function How Many Hours Between Two Times How Many Minutes Between Two Times How Many Seconds Between Two Times How to Calculate Time in Excel How to Subtract Time How to Subtract Time in Excel Minute Function MOD Function QUOTIENT Function SECOND Function Time Between Two Dates

Categories

  • Excel 101
  • Excel Formula
  • Excel Functions

Recent Posts

  • Get the Original Price from Percentage Increase/Decrease
  • How to Add/Subtract Percentage in Excel
  • How to Extract Day, Month and Year from Date in Excel
  • How to Add Seconds, Minutes and Hours to a Time in Excel
  • How to Add Days, Weeks, Months and Years to a Date in Excel
  • How to Calculate Time Difference in Excel
  • Calculate Number of Days, Weeks, Months and Years Between Two Dates in Excel
  • Flash Fill Excel
  • Paste Special Excel
  • Excel TEXTJOIN Function
  • Excel CONCAT Function
  • Excel CONCATENATE Function
  • Excel REPLACE Function
  • Excel SUBSTITUTE Function
  • Excel REPT Function
  • Excel FIND Function
  • Excel SEARCH Function
  • Excel MID Function
  • Excel RIGHT Function
  • Excel LEFT Function

ExcelCSE.com

The Ultimate Guide How to Use Excel Better
Copyright © 2024 ExcelCSE.com
Contact Us - Privacy Policy - Sitemap | Theme by MyThemeShop.com

Ad Blocker Detected

Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker.

Refresh