How to Calculate Time Difference in Excel Between Two Dates (7 Ways)

Get FREE Advanced Excel Exercises with Solutions!

In this article, you will learn 7 quick ways to calculate the time difference in Excel between two dates.


1. Using DAYS Function to Calculate Time Difference in Excel Between Two Dates

You can use the DAYS function to calculate the time difference between two dates in days. Let’s see how to do that,

❶ At first, insert the following formula in cell E5.

=DAYS(D5,C5)

Formula Explanation

  • D5 is the finishing date.
  • C5 is the beginning date.

❷ Now press the ENTER button.

Using DAYS Function to Calculate Time Difference in Excel Between Two Dates

❸ Now drag the Fill Handle icon from cell E5 to E10.

Now you will get the time difference in days between the two dates.

Calculate Time Difference in Excel Between Two Dates

Read More: How to Calculate Time Difference Between Two Dates in Minutes in Excel


2. Combining INT and TEXT Functions to Calculate Time Difference Between Two Dates

You can also use the INT and TEXT functions to calculate the time difference between two days.

Now here are the steps to follow:

❶ At first, insert the following formula in cell E5.

=INT(D5-C5)&" days "&TEXT(D5-C5,"h"" hrs ""m"" mins """)

Formula Explanation

  • D5 is the finishing date.
  • C5 is the beginning date.
  • INT(D5-C5)&” days “ returns the time difference in days.
  • TEXT(D5-C5,”h”” hrs “”m”” mins “””) returns the time difference in hours, minutes, and seconds.

❷ Now press the ENTER button.

Combining INT and TEXT Functions to Calculate Time Difference in Excel Between Two Dates

❸ Now drag the Fill Handle icon from cell E5 to E10.

Now you will get the time difference between two dates in days, hours, and minutes.

Read More: Difference Between Two Dates in Months in Excel


3. Using NETWORKDAYS Function to Measure Time Difference Between Two Dates

The NETWORKDAYS function can calculate the time difference in days between two days. But this function excludes the holidays from the calculation.

To use this function,

❶ Insert the following formula in cell E5.

=NETWORKDAYS(C5,D5)

Formula Explanation

  • D5 is the finishing date.
  • C5 is the beginning date.

❷ After that, press the ENTER button.

Using NETWORKDAYS Function to Calculate Time Difference in Excel Between Two Dates

❸ Now drag the Fill Handle icon from cell E5 to E10.

Using Fill Handle to Calculate Time Difference in Excel Between Two Dates

So you will get the time difference in days excluding the holidays.

Read More: How to Minus Number of Days or a Date from Today in Excel


4. Applying Excel DATEDIF Function to Compute Time Difference Between Two Dates

The DATEDIF function can also return the time difference in days between two dates.

Here are the steps to follow:

❶ First, insert the following formula in cell E5.

=DATEDIF(C5,D5,"d")

Formula Explanation

  • D5 is the finishing date.
  • C5 is the beginning date.
  • “d” specifies that the calculated time format is in days.

❷ Then press the ENTER button.

Applying DATEDIF Function to Calculate Time Difference in Excel Between Two Dates

❸ After that, drag the Fill Handle icon from cell E5 to E10.

Now here is the calculated result:


5. Using Excel TEXT Function to Calculate Time Difference Between Two Dates

The TEXT function allows modifying the format while calculating the time difference between two dates.

Here’s how to use the TEXT function.

❶ At first, insert the following formula in cell E5.

=TEXT(D5-C5,"yy"" years ""dd"" days """)

Formula Explanation

  • D5 is the finishing date.
  • C5 is the beginning date.
  • “yy”” years “”dd”” days “”” specifies the time format in years and days.

❷ Now press the ENTER button.

Using TEXT Function to Calculate Time Difference in Excel Between Two Dates

❸ Now drag the Fill Handle icon from cell E5 to E10.

So you will get the time difference between two dates in years and days.


6. Subtracting Two Dates to Calculate Time Difference Between Two Dates

The simplest way to calculate the time difference between two days is to use the generic subtraction formula.

For that,

❶ Insert the following formula in cell E5.

=D5-C5

Formula Explanation

  • D5 is the finishing date.
  • C5 is the beginning date.

❷ Now press the ENTER button.

Subtracting Two Dates to Calculate Time Difference in Excel Between Two Dates

❸ Now drag the Fill Handle icon from cell E5 to E10.

Finally, you will get the time difference in the Duration column.

Read More: How to Subtract Dates in Excel to Get Years


7. Joining Excel TIME, HOUR, MINUTE, & SECOND Functions to Calculate Time Difference

You can use the TIME, HOUR, MINUTE, & SECOND functions to calculate the time difference between two dates in Excel.

But one thing to mention here. The following formula can calculate the time difference only in hours, minutes, and seconds. It completely ignores the date part but focuses on the time part.

To use the formula,

❶ At first, insert the following formula in cell E5.

=TIME(HOUR(D5),MINUTE(D5),SECOND(D5))-TIME(HOUR(C5), MINUTE(C5),SECOND(C5))

Formula Explanation

  • D5 is the finishing date.
  • C5 is the beginning date.
  • HOUR(D5),MINUTE(D5),SECOND(D5) extract the hour, minute, and second part from D5.
  • HOUR(C5),MINUTE(C5),SECOND(C5) extract the hour, minute, and second part from C5.

❷ Now press the ENTER button.

Joining TIME, HOUR, MINUTE, & SECOND Functions to Calculate Time Difference in Excel Between Two Dates

❸ Now drag the Fill Handle icon from cell E5 to E10.

Finally, you will get the time difference in hours, minutes, and seconds like this:


Download Practice Workbook

You can download the Excel file from the following link and practice along with it.


Conclusion

To sum up, we have discussed 7 easy methods to calculate the time difference in Excel between two dates. You are recommended to download the practice workbook attached along with this article and practice all the methods with that. And don’t hesitate to ask any questions in the comment section below. We will try to respond to all the relevant queries ASAP.


<< Go Back to Subtract Dates | Calculate Dates | Date-Time in Excel | Learn Excel

What is ExcelDemy?

ExcelDemy - Learn Excel & Get Excel Solutions Center provides online Excel training , Excel consultancy services , free Excel tutorials, free support , and free Excel Templates for Excel professionals and businesses. Feel free to contact us with your Excel problems.
Mrinmoy Roy
Mrinmoy Roy

Mrinmoy Roy, a dedicated professional with a BSc in Electronics and Communication Engineering from Khulna University of Engineering & Technology, Bangladesh, brings over two years of expertise to the ExcelDemy project. As a prolific contributor, he has authored around 180 articles, showcasing his deep knowledge and passion for Microsoft Excel, Data Analysis, and VBA. His unwavering commitment to continuous learning, combined with versatile skills, renders him well-suited for roles in data management and spreadsheet solutions. He has interest... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo