Comments on: How to calculate time in Excel - time difference, adding / subtracting times

The tutorial explains different ways to calculate times in Excel and demonstrates several methods of adding times and calculating time difference. You will learn a few useful formulas to sum times and add hours, minutes or seconds to a given time. Continue reading

Comments page 4. Total comments: 622

  1. I am a swim coach and am trying to do an excel sheet where I take a swimmer's best time when they arrive and find the difference when they are done (did they drop time). I have an excel sheet pretty much done and it works well when the time is within the same minute (1:57.56 to 1:55.46 = -:2.10) I use #":"##"."00 as my cell formula. The issue come when I have a time in 2 different minutes (2:01.91 to 1:57.41) this should equal -:4.50 but I get -:44.50. Do you have guidance for me? Thank you in advance

      1. Thank you. My formula lets me put in the times without having to type the punctuations and it lets the time read correctly no matter if it is 10 minutes or 30 seconds. If you do that (type just numbers) you should get the formula to work.

        mm:ss.00 does get the correct number but it does not show a negative (I've played with how but can not make it happen) and it does not format well at least not aesthetically.

        Any other advice?

        1. Hi!
          You will not be able to subtract minutes, since there are 60 seconds in 1 minute. In your case, 1 minute is 100 seconds.

  2. I have an issue with a simple greater than calculation involving time (24hr) and can't seem to find a solution to show that:

    =IF(F1>J1,0,100)

    "23:00" is NOT greater than "0:00" but excel decides this is false.

    How could I determine this when the time rolls over?

    1. Hello!
      Why do you think 23:00 is no more than 0:00? What result do you want to get? Please describe your problem in more detail.

      1. Hi Alex,

        The problem is to figure out If a shipment was sent late, or on time, and then sum up the late ones...

        So with a simple formula, you can see results are not desirable when that midnight time rolls over.

        IF SUM(A1-B1) >0, Then Count it

        LEFT DUE DIFF
        18:30 20:00 -1:30
        20:45 23:00 -2:15
        19:50 21:00 -1:10
        20:45 22:00 -1:15
        22:10 0:00 22:10 <----Not really late
        23:48 1:00 22:48 <----Not really late
        22:40 23:30 -0:50

        Moving forward, we can add the date and that makes it accurate, but the issue is that I've got old entries to tally up and changing the time field to a date just makes it "1/1/1904" for every day.

        Hope that describes it better?

        1. Hi!
          Time 00:00 is less than 23:00 since 00:00 is the beginning of the next day. You can calculate the time difference correctly only within a day. If the start and end times are different days, then you need to use the date and time.
          You have not explained how to determine if the package was sent at the wrong time.

  3. Hello

    I am trying the method of B2-A2 (Updated date/time - Created date/time) and then formatting the results cell with d "days," h "hours," m "minutes and" s "seconds" and all seems well until I get to a certain value and then it is not displaying results correctly. I worked around this by using =INT(B2-A2) & " days, " & HOUR(B2-A2) & " hours, " & MINUTE(B2-A2) & " minutes and " & SECOND(B2-A2) & " seconds" but now I'm trying to average the results of the original B2-A2 values and am getting a value of 61.26262 which when formatting the cell with d "days," h "hours," m "minutes and" s "seconds" I should get 61 days... but am getting 1 days, 6 hours, 18 minutes and 10 seconds. How can I format the cell values to return the correct 61 days? Is it as simple as changing the formatted value of 1 days, 6 hours, 18 minutes and 10 seconds to 61 days, 6 hours, 18 minutes and 10 seconds?

      1. Hello sir ,
        this formula is too good. And I want that same formula in Power BI . Can you please tell me what would be the formula for same purpose in Power BI ?

  4. Hi
    When I'm trying to sum the total time in HH:mm
    Getting the total wrong I have applied the formula =sum(b2:b5) but still getting the wrong total

  5. Looking to calculate the time difference excluding weekends and business hours for the time a user submits a support request. Weekends are sat/sun and business hours are 8-5.

    Example time of the support request:

    Submitted at 7:00am on Friday 5/7/21.

    Request completed at 10:30am on Monday 5/10/21.

    The answer when calculated manually would be 10.5 hours to complete the request.

    What would the formula be for this?

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =IF(NETWORKDAYS.INTL(A2,B2,1)=1,MIN(TIME(HOUR(B2),MINUTE(B2),0),TIME($C$1,0,0))-MAX(TIME(HOUR(A2),MINUTE(A2),0),TIME($B$1,0,0)),(NETWORKDAYS.INTL(A2,B2,1)-1)*($C$1-$B$1)+MAX(0,MIN(TIME(HOUR(B2),MINUTE(B2),0),TIME($C$1,0,0))-TIME(8,0,0))+TIME(18,0,0)-MAX(TIME(HOUR(A2),MINUTE(A2),0),TIME($B$1,0,0)))-IF(TIME(8,0,0)-(A2-INT(A2))>0,TIME(8,0,0)-(A2-INT(A2)),0)

      A2 - start time
      B2 - end time
      B1 -start workday (8)
      C1 - end workday (17)
      The answer calculated 9+2.5=11.5 hours
      I hope I answered your question. If something is still unclear, please feel free to ask.

      1. Hi Alex,
        You formula helps a lot for me. thank you so much for that. pls guide me to exclude weekends (Saturday & Sunday) from the below formula.
        =INT(N374-H374) & " days, "&HOUR(N374-H374) & " hrs, " & MINUTE(N374-H374) & " mns"
        Output is 20 days, 2 hrs, 44 mns.

          1. Alex,
            This is brilliant. It's working. Thank you so much :-)

      2. What if not considering Start workday and end workday and instead just considering 8 hrs a day

    2. Sorry, 11.5.

  6. I have a question here. How to get the hour after minus from 73:50 - 70:91?

    my results show #value

    Hope to hear from you soon.

    Thanks.

    1. Hello!
      Time cannot be written as 70:91. There cannot be more than 60 minutes in an hour. If instead of 70:91 you write 71:31, then you will succeed.

  7. In normal excel sheet I am try to calculate manpower efficiency which need time starts and time end. What is the formula for time starts if the person starts work by pressing "Y" in beside column. I tried with now() formula but it's keep on changing. I need once the activity start time should not be changed when the activity is closed and centering the closing time. I need in if programme

  8. Hello,
    I'm trying to create automatic production schedule. Work hours are from 7:00 to 23:00. I have current date and time. Work that requires 19 hours to complete.
    Need a formula that would pull up current date/time, add 19 hours and show end date/time but in respect to work hours. So if current time is 15:00 it should report end time to be next day at 18:00

    Any help?
    Thanks!

    1. Hello!
      If I got you right, the formula below will help you with your task:

      =IF((HOUR(A2)+B2)>23,A2+TIME(B2,0,0)+TIME(8,0,0),A2+TIME(B2,0,0))

      A2 - current date/time, B2=19
      I hope my advice will help you solve your task.

  9. I need to add data with how long it takes for an agent to complete a workflow. For example, an agent may take 3 mins and 51 seconds for 1 workflow. When I use the time format in Excel, even when I create custom ones in Excel, I'm having a hard time with it showing as 3:51, where 3 is the mins and 51 is the # of seconds. It always ends up showing as hours and mins or the time of day with AM/PM. How can I just get it to just show as 3:51, 3 mins, and 51 seconds. I need to add a lot of data and calculate the averages.

  10. login- 17:30

    Log out time - 3:00

    how to find the difference between these 2 timings

  11. is it possible for the below formula to be working days not just days??

    =IF(INT(M5-I5)>0, INT(M5-I5) & " days, ","") & IF(HOUR(M5-I5)>0, HOUR(M5-I5) & " hours, ","") & IF(MINUTE(M5-I5)>0, MINUTE(M5-I5) & " minutes and ","")

    TIA
    Steph

    1. Hello!
      I believe the following formula will help you solve your task:

      {=SUM(--(WEEKDAY(ROW(INDIRECT(INT($A$1)&":"&INT($B$1))),2) < 6))-2 + B1-A1-INT(B1-A1)+(MOD(B1,INT(B1)) > MOD(A1,INT(A1)))}

      This is an array formula and it needs to be entered via Ctrl + Shift + Enter, not just Enter.

      Use custom date format

      d "d." h "h."m" min."

      I hope I answered your question.

  12. Hello, I need a formula that will help me determine how many calls were happening at 3:00 PM on 11/16. I need to figure out if 11/16/2020 3:00 PM falls between two dates and times.

    For example in row 2 I have join time and leave tine columns with the following data:
    I2: 11/16/20 1:00 PM J2: 11/16/20 1:01 PM
    I3: 11/16/20 13:40 J3: 11/16/20 14:30

    I have about 200 rows with date and times to go through so I need to see if the 11/16/20 3:00 PM date and time falls in between the dates above as well as the other rows. I need an output for each row (whether its true or false).

    After I get this data I can use a count formula to see how many times I get yes which will determine how many calls were happening at 3:00 PM on 3/16.

    My data expands over 48 hours.

    1. Hello!
      The formula below will do the trick for you:

      =AND(M1 > I1,M1 < J1)

      After that you can copy this formula down along the column. I hope my advice will help you solve your task.

      1. Thank you for the information. Do I need to format the dates and time a certain way or format them as something? It's just returning no for everything when I most definitely have some Yes ones.

    2. I should have mentioned the date AND time are both in one column, it is not separated. I need to keep the date and time together.

  13. How do i subtract from (29 minute:17 second:13 millisecond - 28 minute:15 second :90 millisecond) in excel

    1. Hello!
      Write in cells

      00:29:17.013
      00:28:15.090

      Use custom format h:mm:ss.000
      Subtract the second from the first value.

  14. Good afternoon, I have some days where I clock in at 5:00 am out at 11:00 back in 30 minutes later and then out at 1:30pm. But then there are some days in which I will be in and out 3-4 days in a day. example would be Monday 5:00 - 11:00, back in at 11:30 and work till 1:30. But today because I have to go into the office it would be 5:00 - 8:30, 9:15 - 10:30, 12:00 - 2:00, 4:00 - 6:00 pm. I have tried using: =IF(OR(B2="",I2=""),"",(C2-B2)+(E2-D2)+(G2-F2)+(I2-H2)) but the time will not round and I'm still coming up short. Whatever suggestion you have it would be TRULY APPRECIATED because I hate to have to make up time when I'm short 1 day and over the next.
    Sincerely,
    Frustrated!!!

    1. Hi Alexander, I need a formula that tracks multiple times that I would clock in and out of work. Clock in the morning, then clock out for break, back in from break, then out for lunch, clock back in from lunch, then out for break, then return from break, then out for a second afternoon break then clock back in from that break until I clock out for the day.

      example:
      clock in at 5:00 AM, out at 7:00 for 30 minutes then i clock back in at 7:30, work from 7:30 until 11:00 then it's lunch from 11:00 am until 11:30 then i clock back in, then at 1:00 PM I clock out for 30 minutes and return at 1:30 until the end of my shift.

      so any formula you could share would be greatly appreciated.

      1. Hello!
        I don't know how the data is written in your table. If each arrival at work and breaks in work are written in one line, then the formula may be as follows:

        =C2-B2+E2-D2+G2-F2+I2-H2+K2-J2+M2-L2+O2-N2+Q2-P2

        If there is anything else I can help you with, please let me know.

        1. Alexander the formula works great. One last tweek if you don't mind. Our systems rounds up when keyed. I do truly appreciate your assistance, maybe i can stay out of trouble now. :)

          1. Hi,
            Please explain in more detail which results are being rounded. What exactly is the problem? Explain in more detail.

            1. the formula for time adds up across the cell and was wondering if there was a way to get the ending balance to round up? say i worked for 8 hours and 37 minutes, how to get this 37 minutes to round up to 45 minutes?

  15. 1st condition = should be after 8:30 AM
    2nd condition = should be before 4 PM
    Cannot find the right date. Struggle with AM/PM thing (confuse)
    for eg.

    =if(and(10:20 AM>=8:30 AM,10:20 AM<=4:30 PM),"within","out")

    note: 10:20 here is random time.
    Could you help whats wrong with formula and how can I get the right condition?

    1. Hello!
      If I understand your task correctly, you need to use TIME function to compare time

      =IF(AND(A10 >= TIME(8,30,0),A10 <= TIME(16,30,0)),"within","out")

      Hope this is what you need.

  16. hello, how to calculate times between 9AM-9PM and 9PM-9AM if I have '14-Jan-20 05:00' (F2) as a reported date and '15-Jan-20 13:00' (G2) as a resolved date? Thank you in advance :)

    1. and the output that I expected is 16:00 (means 16 hours) for 9AM-9PM and also 16:00 for 9PM-9AM :)

      1. Hello!
        I wrote this formula based on the description you provided in your original comment. My result is 12 hours. Explain your calculations. Does 9 PM-9AM mean 21:00 - 09:00? Are you subtracting time or date and time? It is impossible to understand from your question.

  17. John,
    Wouldn't that cause a circular reference?
    C9: 8:30
    B9: 19:30 (which baffles me to put the End time in B and Stat time in C...?)
    Then, in D9, we subtract those two AND subtract D9 itself from that?... ???

    1. Hello!
      I didn't quite understand your problem. But it might be useful.
      If start time is greater than end time, then you need to add 1 day to their difference

      =IF(A1 > A2,A2-A1+1,A2-A1)

      I hope this will help

  18. I need to figure out how can i get event time/run time of every account having multiple transactions, i need time duration between First till last transaction of every account, every account having multiple transactions count.

    1. All data is in one sheet, first column having account number, then amount then date time then type

  19. Hey I have a timesheet that I would like to calculate the specific hours given is counted as overtime 1 which is from 22:00 PM - 06:00 AM, time after 06:00 AM will be calculated as overtime 2. I wanna get the hours worked in oveRtime 1 is how many hours? is that possible.
    For example:
    TIME IN (A1) = 12:00AM
    TIME OUT (B1) = 11:00 AM
    hours worked in overtime 1 is 8 hours, and in overtime 2 is 5 hours.

  20. hey so i have a timesheet for work i need it to calculate total hours, overtime 1 and overtime 2
    where hours from 07:00-15:00 is normal hours so no overtime counted
    hours from 15:00-17:00 is counted in overtime 1
    and all other hours is counted in overtime 2
    like so
    if A1(start time)=07:00 B1(end time)=19:00 C1(total hours)=12 D1(overtime1)=2 E1(overtime2)=2
    or A1(start time)=04:00 B1(end time)=16:00 C1(total hours)=12 D1(overtime1)=1 E1(overtime2)=3

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =B1-A1

      =IF(AND(B1>TIME(15,0,0),B1<TIME(17,0,0)),B1-TIME(15,0,0),TIME(2,0,0))

      =IF(B1>TIME(17,0,0),B1-TIME(17,0,0),0)

      I hope it’ll be helpful.

  21. I need to calculate sub of two times Eg: 06:00-09:00 in 24HRS
    Ans should be in 24HRS Format
    I want to get 21:00
    Can you help Me?

  22. Hello.
    I'm looking for a formula. I made one that gives the total worked hours. But my problem is, let's say the office time starts at 8am, the formula includes the time over or under 8am which the minutes for late and early in is computed.

    1. Hello!
      If start time is greater than end time, then you need to add 1 day to their difference

      =IF(A1 > A2,A2-A1+1,A2-A1)

      I hope this will help

      1. Thank you for help works well

  23. I have 12:10 formatted as [hh]:mm in cell A1. How can I separate the hours and minutes so that the hours appear in A2 and the minutes appear in A3?

  24. How to get diff in days,hours,minutes,seconds,milli seconds for below
    Min time stamp: 2019-06-14 09:16:13.013
    Max time stamp: 2019-09-14 09:16:12.310

    1. Hello!
      Find the difference between these dates using normal subtraction. To determine the difference in time in days, hours, minutes and seconds, apply the formula to the cell with the result:

      =INT(A1)&" days "&INT(MOD(A1,INT(A1))*24)&" hours and "&MINUTE(A1)&" minutes, "&SECOND(A1)&" seconds"

      I hope my advice will help you solve your task.

      1. I need for milliseconds as well. Above works until seconds only.

        1. Hi Alexander Trifuntov (Ablebits.com Team),

          =INT(A1)&" days "&INT(MOD(A1,INT(A1))*24)&" hours and "&MINUTE(A1)&" minutes, "&SECOND(A1)&" seconds"

          Can you also add calculation for milliseconds as well in above?

  25. Need Excel formula for calculating the hours and minutes between to different AM and PM high tides. The two different AM (A1) and PM (B1) times could be different. The A2 could be a higher number then the B1 time number and vise versa. Need this formula for calculating this for each day of the year.

    1. Hello Robert!
      If the end time is longer than the start time, then you need to add 1 day to their difference

      =IF(A1 > A2,A2-A1+1,A2-A1)

      I hope this will help

  26. Hi, my roster is published with start & finish in the same cell. is there a way to tell the time difference between start & finish (I need an 11 hour break)?

    1. Hello!
      Please describe your problem in more detail.Include an example of the source data and the result you want to get. It’ll help me understand your request better and find a solution for you. Thank you.

    2. that should read betrween finish & start - between days

  27. Hello,

    If we are Summing times in a "total" cell, how do you include days? So far I managed the following:
    =SUM($D$2:$D$4)&" days, "
    this got me 39.7148.... days
    but it does not breakout down into days, hours, minutes, and seconds like the interval equation or the subtraction formatting did.
    If I manipulate the format and just sum the range, instead I get like 929 hours, 9 minutes, and 21 seconds instead of it breaking it down into days.
    What I want is for the total cell to show the total times added together as something like "38 days, 17 hours, 9 minutes, 21 seconds"

    1. Hello Samantha!
      To display the total amount of time in days, hours, and minutes, use the formula

      =INT(A1)&" days "&INT(MOD(A1,INT(A1))*24)&" hours and "&MINUTE(A1)&" minutes, "&SECOND(A1)&" seconds"

      I hope it’ll be helpful.

  28. Hello
    I want to calculate time elapsed between 2 dates and times h:m
    then i want the result in minutes rounded up to the hour if more than 50 min

    1. Hello!
      The following formula rounds the time to an hour if the number of minutes is more than 50:

      =IF(MINUTE(A1)>50,ROUND(A1*24/1,0)*(1/24),A1)

      I hope my advice will help you solve your task.

  29. Hi how do I calculate the difference in time of my end time is going to be in a different cell each time my start time will always be in B2 for example but my end time moves depending on the amount of tasks performed.

    1. hello Steven!
      The difference between the two dates can be calculated using the DATEDIF function. Read the instructions here.

  30. I have a list of dates and times and need to total the number of entries that have the same hours:minutes (within a date). I'm having trouble comparing as with different seconds the cells are different even if the view (HH:MM) is the same and comparing the difference doesn't work if one is 8:23:45 and the next is 8:24:12 is there a way to subtract the seconds so there is always comparable minutes? The list is in ascending order.

    1. Hello Steve!
      If your data is written in column F, then you can use the formula to count duplicate hours and minutes

      =SUMPRODUCT(--(HOUR($F$2:$F$6)=HOUR($F$2)), --(MINUTE($F$2:$F$6)=MINUTE($F$2)))

      and then copy it down along the column.
      You can read about finding duplicates here.

  31. Hi, I just want to simply be able to subtract times in order to get the number of hours worked. For example, in the first column is 10:00 AM (A1), in the second column is is 2:20 PM (B1). I tried doing =B1-A1 to get the total hours, but the resulting cell is showing me 4:20 AM. How do I convert this cell into an actual number of hours, and not formatted in that way?

    1. Go to the cell in question (the one that is showing you 4:20 AM) and then go to Number Format, scroll down to More Number Formats, (alternatively you can just right click, then click Format Cells), on the Number tab click TIME, under "Type" click 13:30. This will give you your answer in the format I think you want: 4:20 meaning 4 hours and 20 minutes worked.

  32. Dear sir I am having 80 customer around the world from - india how I can know the time of that cotumer to whome I want to talk, I know if my cutomer is in Totanto a time is GMT -5.30 and Totanto time is -4 how I will calculate in excel. Sheet. And same with other customers.please explain

  33. I want a formula for vehichle down time. The vehicle duty time is 08:am to 07:59pm. Then the vehicle down for continuous 3 days( 4th may 2020 11:35 am to 7th may 2020 06:20 pm). Then how many hours and minutes down in per day calculation.

    1. Hello!
      If the first date is written in cell A1, and the second in cell A2, then the formula
      =(A2-A1)/number_of_days
      Set the time format to "37:30:55" in the cell with the formula

  34. Hi Alex, I need to calculate the hours between two dates but excluding the holidays or weekends.Please help

  35. Hi Alexander,
    May i know what formula do i use if i want the leftover number of minutes (don't need hours) for the below scenario and what format should i set it to?

    START BREAK TIME: 13:15 (IN 24HOURS)
    END BREAK TIME: 13:30
    TOTAL TAKEN: 0:15 (MINUTES)
    LEFTOVER NUMBER OF MINUTES (IF I'M GIVEN 30MIN OF BREAK TIME): ?

    Thanks in advance :)

    1. Hello!
      To subtract time in Excel, use the usual subtraction formula =A2-A1
      You can use other methods of calculating the time difference, which are indicated in the instructions above.
      Please go to Format Cells, choose Number -> Custom Format and set
      mm:ss
      In this case, the number of minutes will not exceed 60

    2. in another words, i have recorded the break time used which is 0:15 minutes after subtracting a time from another time. i need a formula to show how much time is left if break time is given for 30 min.

      thanks again!

  36. Looking to calualte the duration between today's date and the date something was entered into my system

    i.e. created date 06/01/2019 -looking for length of time between whatever inputted date verus todays date, can some one help with the formula please?

  37. Trying to subtract one time from another ... including milliseconds and microseconds.
    Format is HH:MM:SS.mmm µµµ
    Example: 15:57:53.529 016 - 15:57:52.896 516 = 0.6325
    Any help would be most greatly 'preciated!

    1. If the time difference is negative, add 1 day (24 hours)

      =IF(B3 > B1,B1-B3+1,B1-B3)

      To the start time you need to add 1 day.
      I hope it’ll be helpful.

  38. hello. suppose i want to calculate OT hrs where staff sign in time is 9:00am and signout time is 3:00 pm. total working hrs is 6. after deducting 4 hrs which is compulsary to work, how could i find the exact time when OT starts? what will be the formula.
    thank you for the help in advance

    1. Hello!
      If A1 is the start time, B1 is the end time, then OT in cell C1

      =B1-A1-TIME(4,0,0)

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. Sir

        the start time and end time in single cell how to calculate. i.e.
        07:00-19:00
        22:00-2:00
        i need to reduce 1 hr. where working hors are more then 8 and 30 min where working hours are less then 8.

  39. I am trying to figure out how to subtract time in excel. For example, I have to complete 250 hours of course work this summer. I am wanting to subtract the total hours I currently have from 250 hours, to come up with the number of hours I have remaining. I have 13:45 hours right now and can't seem to get the formula right to subtract that from 250 hours.
    Any help would be much appreciated!

    1. Hello Erin!
      To record time in a cell more than 24:00:00, use the time format "37:30:55". Next apply regular subtraction
      =B1-A1
      I hope this will help, otherwise please do not hesitate to contact me anytime.

  40. I'm racking my brain trying to figure this one out. I'm running a compliance audit whereby I need to work out how much time is worked before 6 AM and how much time is worked after. In other words, if my candidate worked from 1 AM to 9 AM, I need to be able to return a result that tells me 5 hours were worked before 6 AM. Any help is warmly appreciated.

    1. Hello Adam!
      If I understand your task correctly, the following formula should work for you:

      =IF(A7 > TIME(6,0,0),TIME(6,0,0)-A7+1, TIME(6,0,0)-A7)

      I hope this will help

  41. I want to substract 8:00hrs in cell 1 from 4:00hrs in cell2 and also if cell 2 value is 9:00hrs so result should be zero.
    Please help with query.

    1. Hello!
      If I understand your task correctly, the following formula should work for you:

      =IF(M2 <> TIME(9,0,0),IF(M2 < M1,M2-M1+1,M2-M1),0)

      Hope this is what you need.

  42. Hi, I want to calculate the elapsed time students attended my class online. The report shows the time in a format like this:
    2020-05-12 15:41:08
    When I subtract the value of the two cells, I give #VALUE! error. I need the results in h:mm format. I appreciate it if you could help me with a solution.

    1. Hello Alireza!
      Most likely, you have a non-printable character in front of the date. You cannot see him. This often happens when importing data from other programs into Excel.
      Try using the CLEAN function:

      = CLEAN(C2) -CLEAN(B2)

      I hope this will help, otherwise please do not hesitate to contact me anytime.

      1. Dear Alex!
        Thanks for the quick reply. Unfortunately, it doesn't solve the problem. The same #VALUE! error exists.

  43. Hello! I need to calculate the time between 05-05-2020, 07:16:58 and 05-05-2020, 07:17:02. This is how it is populated on a report I download. I have tried =C11-B11 as a suggestion and also =TEXT(C11-B11,"d:h:mm:ss"), but I think the comma after date is causing issues.

    1. Hello Sheree L!
      The formula below will do the trick for you:

      =DATEVALUE(SUBSTITUTE(B1,",",""))+TIMEVALUE(SUBSTITUTE(B1,",","")) - DATEVALUE(SUBSTITUTE(A1,",",""))-TIMEVALUE(SUBSTITUTE(A1,",",""))

      or

      =SUBSTITUTE(B2,",","")-SUBSTITUTE(A1,",","")

      Remember to set the time format in this cell.
      I hope it’ll be helpful.

  44. In A1 i have a start time as 21:30:00 and in A2 an end time of 08:55:00 and have the formula of =IF(A2<A1,A1-A2+24,A2-A1)in A3; however A3 calculates as 12:35. Cells A1 and A2 set to [h]:mm:ss. Cells in A3 set to h:mm. I need A3 to calculate the actual time between 21:30 the previous evening to 08:55 the next morning in h:mm as the time of travel is through the night.

    Thanks.

    1. Hello Austin!
      If I understand your task correctly, the following formula should work for you:

      =IF(A1 > A2,A2-A1+1,A2-A1)

      I hope this will help, otherwise please do not hesitate to contact me anytime.

    2. Note: A3 should calculate to 11:25 (11 hours and 25 minutes) elapsed time since commecing at 21:30:00, but calculates AS 12:35 (12 hours and 35 minutes).
      Thanks for your support.

  45. Hi
    I have made a simple work schedule to show when each colleagues shift will be.
    I have a single cell displaying their start and end time (eg 10:00-14:00).
    the next column is for the number of hours in their shift.
    Is there a way I can get it to work out the number of hours in the shift automatically, or would I have to have a start and finish time in separate columns.
    I use the same sheet to print and put on the notice board so need it reader friendly.

    thanks!

    1. Hello Louise!
      Of course, it’s better to record the start time and end time in two different columns. But in your case, you can use the following formula:

      =TIMEVALUE(MID(A10,FIND("-",A10,1)+1, LEN(A10)-FIND("-",A10,1))) - TIMEVALUE(LEFT(A10,FIND("-",A10,1)-1))

      Remember to apply the time format to the cell with this formula.
      I hope it’ll be helpful.

      1. Hy. The formula works. I have the same schedule format. But how do I sum up with this formula for multiple days to get the final time number?

        1. Hello!
          You need to find the sum of the cells and the original time (12:10, etc.). Use the guidelines from the "How to sum over 24 hours in Excel" section above.
          I hope this will help

  46. How do you calculate the difference of day and time between days into minutes in one cell?

    for example:
    I have a email that came in last night at 8:30pm and i answered to the email at 10:30am the next day. How many minutes is in between of my response time?

    Also if it was during the weekend days how would it calculate the time?

    1. Hello Roxy!
      I recommend reading the first part of the above article, 'How to calculate time difference in Excel', to answer your question.
      To be able to show more than 24 hours in a cell, please use this time format: "37:30:55". You can find it in the list of Excel time formats.

      If Saturday and Sunday are traditionally considered to be days off, it is possible to exclude those 2 days from calculations with the help of this formula:

      =IF(WEEKDAY(A3) < WEEKDAY(A2),A3-A2-2,0)

  47. I do have two columns with date and time. I want to calculate the difference between them (so, that is pretty easy, only subtract). My issue: 1. End date sometimes is "Null" - in that case I tried to solve by adding if and setting the difference time to 999 or so. 2. I would like output to be in Days, Hours, Minutes, but days shown only if they are >0; and I want result still be a number (for the graph later). Original fields are in format yyy-mm-dd hh:ss. Is there a way to display this? I believe it is possible to do with IF by putting "" if month value is 0, but won't that put the result to text field format? Also, that is pretty lengthy formula, maybe there is a function or format that I am not aware of?

    1. Hello!
      If I understand your task correctly, please go to Format Cells, choose Number -> Custom Format and set
      [>1]m"m." d"d." hh:mm:ss;[<=1] hh:mm:ss;@

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  48. how to figure out the diffrence between time in days if some of them have end date and some dont?

    1. Hello SHAFF!
      If I understand your task correctly, the following formula should work for you:

      =IFERROR(DATEDIF(A1,A2,"d"), DATEDIF(A1,TODAY(),"d"))

      I hope this will help, otherwise please do not hesitate to contact me anytime.

  49. Hi,
    I have Excel sheet where open Date is available in A column, And Time is available in B column, and closing date & time available in C & D Column. How can i find total time duration between open date & closing date. Thank you for your advise.
    BR,
    John Paul.

    1. Hi John,

      The formula below will return you the number of days between open & closing date:

      =INT(C1+D1-A1-B1)

      In order to calculate this duration in hours, please use the following formula instead:

      =TIME(,(C24+D24-A24-B24- INT(C24+D24-A24-B24)) *24*60,)

      Note! Don't forget to set the Time format for cell E1.

  50. How can I convert times to decimals in military time? I'm trying to write a sheet where I input time in and time out using 4 digit military time (6 AM as 0600, 2 PM as 1400), and receive total hours worked. For example, I have time in as 0800, Time out as 1630, and I'd like to get an answer of 8.5 for the number of hours worked. Not 8:30. No colons. Just decimals where half hours are displayed as .5.

    Thank you

    1. Hello Steve,

      Supposing that your times are in A1 and B1 (800 and 1630 accordingly), the following formula will do the trick for you:
      =(TIME(LEFT(B1, LEN(B1) -2), RIGHT(B1, 2), )-TIME(LEFT(A1, LEN(A1)-2), RIGHT(A1, 2), ))*24

Post a comment



Thanks for your comment! Please note that all comments are pre-moderated, and off-topic ones may be deleted.
For faster help, please keep your question clear and concise. While we can't guarantee a reply to every question, we'll do our best to respond :)