Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to calculate time difference between two times or dates?

If you have two lists of time, such column A and column B (the time in column A is earlier than column B in the same row), as shown as below screenshot, and you cannot get the right time different with later time subtracting the early one. So now, I talk about the methods to calculate time difference in Excel.


Easily add hours/minutes/seconds to a datetime in Excel

Supposing you have a date time format data in a cell, such as 2015/5/3 17:53:20, and now you need to add a number of hours, minutes, or seconds to this date. Normally, using formula is the first method for all Excel users, but it’s hard to remember all formulas. With Kutools for Excel’s built-in Commonly-used Formulas you can easily add hours, minutes or seconds to a date time with formulas, and you don’t need to remember the formula at al. Click for 60 days free trial!
doc add hour minute second
 
Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days.

Excel Productivity Tools

Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial

Kutools for Excel: Save 70% of your time and solve 80% Excel problems for you. 300+ advanced features designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial


arrow blue right bubble Calculate time difference between two times in Excel


In our case, we suppose there are only hours, minutes and seconds in two columns, and the time in column A is always earlier than Column B in the same row.

1. Select a blank cell, in this case, I select Cell C2, type this formula =B2-A2+(A2>B2) (the time in Cell A2 is earlier than the Cell B2, you can change them as you need), press Enter key and then drag the fill handle to fill the range needed to apply this formula. See screenshot:

2. Select the result range, in this case select the result range C2:C6, and right click > Formats Cells in the context menu. See screenshot:

3. In the Format Cells dialog, click Number tab > Time, and select the time format you need from the right section, click OK. See screenshot:

Then you can see the time difference has been calculated as shown below:


arrow blue right bubble Calculate time difference between two dates in Excel

If there are not only hours, minutes and seconds but also dates in the columns, you can do as follow:

1. Select a blank cell, in this case, I select Cell C2, type this formula =B2-A2 (the time in Cell A2 is earlier than the Cell B2, you can change them as you need), press Enter key and then drag the fill handle to fill the range needed to apply this formula. See screenshot:

2. Select the result range, in this case select the range C2:C6, and right click > Formats Cells in the context menu. See screenshot:

3. In the Format Cells dialog, click Number tab > Time, and select 37:30:55 from the Type section, click OK. See screenshot:

Then you can see the time difference has been calculated as shown below:


arrow blue right bubble Display the time difference as decimal hours, minutes or seconds with Kutools for Excel

If you want to display the calculated time difference as decimal hours, minutes or seconds, you can use the Convert Time utility of Kutools for Excel.

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

After free installing Kutools for Excel, please do as below:

1. Select the calculated result, see screenshot:
doc time difference kte 1

2. Click Kutools > Content > Convert Time to show the submenu, and you can choose Time to Hours, Time to Minutes or Time to Seconds as you need. See screenshot:
doc time difference kte 2

After you choose an option, the selected data has been converted decimal hours, minutes or seconds.

Displayed as decimal hours
Displayed as decimal minutes
Displayed as decimal seconds
doc time difference kte 3
doc time difference kte 4
doc time difference kte 5

Note:

If you want to save the converted result at another location, you can select the data and click Kutools > Content > Convert Time > Convert Time to enable the Convert Time dialog, and select a convert type, and check Save to another location and select a cell to put out result. Click Ok.

doc time difference kte 6doc time difference kte 7

arrow blue right bubble Convert time to decimal value


add same text to a specific location of each cell in Excel

How could you add text or characters to the beginning of multiple cells, or add text or characters to the end of cells or insert text or characters between existing text? With Add Text utility of Kutools for Excel, you can quickly apply the following operations: . Click for 60 days free trial!
doc add text 6
 
Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days.

Relative Articles:


Excel Productivity Tools

Ribbon of Excel (with Kutools for Excel installed)

300+ Advanced Features Increase Your Productivity by 70%, and Help You To Stand Out From Crowd!

Would you like to complete your daily work quickly and perfectly? Kutools For Excel brings 300+ cool and powerful advanced features (Combine workbooks, sum by color, split cell contents, convert date, and so on...) for 1500+ work scenarios, helps you solve 80% Excel problems.

  •  Deal with all complicated tasks in seconds, help to enhance your work ability, get success from the fierce competition, and never worry about being fired.
  •  Save a lot of work time, leave much time for you to love and care the family and enjoy a comfortable life now.
  •  Reduce thousands of keyboard and mouse clicks every day, relieve your tired eyes and hands, and give you a healthy body.
  •  Become an Excel expert in 3 minutes, and get admiring glance from your colleagues or friends.
  •  No longer need to remember any painful formulas and VBA codes, have a relaxing and pleasant mind, give you a thrill you've never had before.
  •  Spend only $39, but worth than $4000 training of others. Being used by 110,000 elites and 300+ well-known companies.
  •  60-day unlimited free trial. 60-day money back guarantee. Free upgrade and support for 2 years. Buy once, use forever.
  •  Change the way you work now, and give you a better life immediately!

Office Tab Brings Efficient And Handy Tabs to Office (include Excel), Just Like Chrome, Firefox, And New IE

  • Increases your productivity by 50% when viewing and editing multiple documents.
  • Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
  • Open and create documents in new tabs of same window, rather than in new windows.
  • Help you work faster and easily stand out from the crowd! One second to switch between dozens of open documents!
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    prasad nalluri · 4 days ago
    how to calculate difference for the below scenario


    4/8/2019 10:18:22 AM

    4/8/2019 6:10:01 PM

    please help me..
  • To post as a guest, your comment is unpublished.
    Rlicmoan · 1 years ago
    Hi there, I know how to calculate the difference between a start and finish time. However, I would like to know what is the formula when I also want to minus a target date Is there such a formula?



    example: start date: 10/29/17 12:00 AM

    A. 1st transaction date: 10/28/17 03:22 PM
    B. end of 1st transaction date: 10/30/17 01:13 PM


    if Column A is not equal to 10/29/17 12:00am then excess hours should be subtracted from the accumulated hrs from A and B
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Sorry, Could you give a compliacted instance? Through your description, I do not understand clearly.
  • To post as a guest, your comment is unpublished.
    Julie Fuller · 1 years ago
    Hi there, I know how to calculate the difference between a start and finish time. However, I would like to know what the formula is when I also want to minus 30minutes. Is there such a formula?
    • To post as a guest, your comment is unpublished.
      Sunny · 1 years ago
      Thanks for your leaving massage, you can try this formula =A1-TIME(0,30,0). See screenshot:
  • To post as a guest, your comment is unpublished.
    Rats · 1 years ago
    Hi team,

    i want to caluculate the time difference in the same cell ans the working hours should be come in next colum
    for example under timings 9:00am-06:00pm is there i want to know the working time in hours for example like 8 hrs or 9 hours like that.

    Sample:
    Timings Hours
    09:15 AM - 06:15 PM
  • To post as a guest, your comment is unpublished.
    Prabhu · 2 years ago
    I want to highlight the late comers time by getting the difference of exceed time(late time) with the actual time
    For ex:
    if the actual time is 8.00AM if anyone comes by 8.30AM ,the time difference be 0.30minutes ..
    How can i highlight that 30 minutes using conditional formating in excel? or is there any options to highlight that?