EDUCBA Logo

EDUCBA

MENUMENU
  • Explore
    • EDUCBA Pro
    • PRO Bundles
    • All Courses
    • All Specializations
  • Blog
  • Enterprise
  • Free Courses
  • All Courses
  • All Specializations
  • Log in
  • Sign Up
Home Excel Excel Resources Excel Tips Time Difference in Excel
 

Time Difference in Excel

Madhuri Thakur
Article byMadhuri Thakur

Updated August 21, 2023

Time Difference in Excel 2

 

 

Time Difference in Excel

  • In this article, we will learn about Time Difference in Excel. Time is a numeric value formatted as time, but subtracting one value from another gives a decimal number, and again we have to format it as time.
  • The mathematical formula is End Time – Start Time.
  • We can subtract the start and end times to get the time difference.

Today, we will work in various ways to calculate the difference between two-time values.

Watch our Demo Courses and Videos

Valuation, Hadoop, Excel, Mobile Apps, Web Development & many more.

How to Implement Time Difference in Excel?

In MS Excel, we can implement the Time value in a cell in 3 methods:

Method 1

Go to the Home tab, and in Number Group, select Click on Time from the drop-down menu to change the cell value into a Time value.

time in excel 1-1

Method 2

Go to the Home tab in Number Group and Click on the dialog box launcher icon as shown below.

time in excel 1-2

A dialog box of “Format Cells” will open. We need to select the Time option.

time in excel 1-3

Select the type of time format as required. By default, it is 13: 30: 55. Click OK.

Method 3

Select the Cell.

time in excel 1-4

Press the right-click button on the mouse. Click on the Format Cells Option.

time in excel 1-5

A “Format Cells” dialog box will open. We have to click on the Time option.

Select the type of time format as per requirement. Then Click on OK.

time in excel 1-6

You can download this Time -Difference-Excel-Template here – Time -Difference-Excel-Template

Calculating the Time Difference – Example #1

If we want to calculate the time difference between 6.00 pm and 9.00 pm, deduct 9.00 pm and 6.00 pm.

In the figure below, we will find out the time difference.

time example 1-2

Select Cell B4.

time example 1-1

Write the formula as “= B3-B2 “.

time 1-3

Press Enter button, and the result will show as 3:00 am.

time 1-4

Go to the Home tab and select the Drop-Down menu in Number Group. Click on time to change the cell value into a Time value.

time 1-5

The result will show as 3:00:00.

time 1-6

This can be done alternately:

Select cell B4.

time 1-7

Write the formula as “= HOUR(B3 – B2).

time 1-8

Press Enter button, and the result will show as 3.

time 1-9

  • Suppose the time difference is in an hour: minute format, and we want to see the hour and minute difference in separate cells.
  • We want to calculate the time difference between 6.30 pm and 9.00 pm

Select Cell A5.

time 1-10

Write the formula as “= HOUR( B3-B2) “to calculate the exact hours irrespective of the minutes and seconds.

time 1-11

Press Enter button, and the result will show as 2.

time 1-12

Select Cell B5.

excel 2-7

Write the formula as “= MINUTE (B3-B2)” to calculate the exact minutes irrespective of the hours and seconds.

excel 2-8

Press Enter button, and the result will show as 30.

excel 2-9

Adding Time Value to Time – Example #2

  • In Excel, one day means 1, which is 24 hours. This represents as times and hours are fractions of 1.
  • Now the problem is when the time crosses midnight. That means the day changes. In that case, the calculation is to be done differently.
  • For example, if the start time is 8:00 pm on Day 1, and the end time is 7:00 am on Day 2, the start time becomes greater than the end time, then the (end time – start time) formula will give a negative value.
  • It will show an error with the value of hash characters (#) in the cell.
  • So, to avoid this issue, we can use the following formula for times that cross a day boundary:

=1-start time + end time

  • If we deduct the start time from 1, we find the time value on day 1. Then we will add that value to the time value( End time ) on day 2.

Select Cell B3.

example 3-1

Write the Formula as “= 1 – B1 + B2 “

example 3-2

Press Enter button, and the result will show as 11:00 am.

example 3-3

Go to the Home tab and select the Drop-Down Menu in Number Group.

Click on time to change the cell value into a Time value.

time in excel 3-4

The result will show 11:00:00.

example 3-5

Generalized Format of Formula – Example #3

The previous formula will only work if the day changes. So we need to use a generalized format of formula.

For this reason, we can also use the following formula:

= MOD (End Time – Start Time, 1)

Select cell C2.

example 4-1

Write the formula as “= MOD ( B2-A2, 1) “.

example 4-2

Press Enter button, and the result will show as 4:00 am.

example 4-3

Go to the Home tab, and click on the drop-down menu in Number Group.

Click on time to change the cell value into a Time value.

time-in-excel-4-4

The result will show as 04:00: 00.

example 4-6

Drag or Copy the Formula of C2 to C3, and the result will show as 23:00:00.

example 4-7

Things to Remember About Time Differences in Excel

  • The formula will work only with the data within a 24-hour time frame. It does not work if the end time and start time difference are more than 24 hours.
  • We might need to customize the cell format of time like Hours: Minutes, that is, hh: mm.

Recommended Articles

This has been a guide to Time Difference in Excel. Here we discuss How to Implement Time Difference in Excel, practical examples, and a downloadable Excel template. You can also go through our other suggested articles.

  1. Time Function in Excel
  2. Excel Sum Time
  3. VBA Time
  4. Excel Subtract Time
Primary Sidebar
Footer
Follow us!
  • EDUCBA FacebookEDUCBA TwitterEDUCBA LinkedINEDUCBA Instagram
  • EDUCBA YoutubeEDUCBA CourseraEDUCBA Udemy
APPS
EDUCBA Android AppEDUCBA iOS App
Blog
  • Blog
  • Free Tutorials
  • About us
  • Contact us
  • Log in
Courses
  • Enterprise Solutions
  • Free Courses
  • Explore Programs
  • All Courses
  • All in One Bundles
  • Sign up
Email
  • [email protected]

ISO 10004:2018 & ISO 9001:2015 Certified

© 2025 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more

EDUCBA
Free Excel Course

Excel functions, formula, charts, formatting creating excel dashboard & others

By continuing above step, you agree to our Terms of Use and Privacy Policy.
*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA

Download Time -Difference-Excel-Template

EDUCBA Login

Forgot Password?

EDUCBA

Download Time -Difference-Excel-Template

EDUCBA

डाउनलोड Time -Difference-Excel-Template

🚀 Limited Time Offer! - 🎁 ENROLL NOW