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 2. Total comments: 633

  1. I’m trying to do a rota so for example if I put some one down for say a 10:00 - 18:00 there entitled to 30 minute break so it calculates there hours for me minus the 30 minutes

    1. Hi! Find the difference between the end time and the start time and subtract another 30 minutes. To set a specific time, use the TIME function. For example:

      =A2-A1-TIME(0,30,0)

  2. How do you convert a negative value from hh:mm to minutes? For example, if you were subtracting 9:00 PM and 7:30 PM and got -1:30, how would you convert that to -90.00?

  3. What is the formula to calculate the working hours between the following (16/11/2023 09:08 and 23/02/2024 14:31) if working hours are Mon-Fri 07:30-16:00

    1. Hi! Use the NETWORKDAYS.INTL function to calculate the number of working days between two dates. To calculate the working hours between dates, try this formula:

      =(NETWORKDAYS.INTL(A1, B1,1 )-2)*TIME(8,30,0) + TIME(8,30,0)-MAX(0,(A1-INT(A1)) - TIME(7,30,0)) + TIME(8,30,0) - MAX(0,TIME(16,0,0)-(B1-INT(B1)))

      Set a custom time format [h]:mm in the formula cell using these instructions: How to show over 24 hours, 60 minutes, 60 seconds in Excel.

  4. Hi.

    I used If function to find night time work hour for shift between 9PM to 6:AM for example clock in 2PM lock Out 10AM result 1 hours. but now i could not remember how to format the function. could you help please? thanks

  5. I'm trying to find a formula that shows the difference between two times (seconds) in percentage.
    For example, Current time is 18.2 seconds and New time is 16.8, how do i calculate the difference to show in percentage. Also what if the current time is 18.2 seconds and the New time is 55.9 seconds, is the formula different? Thanks in advance.

  6. Using a stopwatch with a "lap" function (made with VBA code), time is auto logged in column A as 0:00:00. When I use =SUM for the A cells, it does not auto add the times. (if A2 is 0:00:10, A3 is 0:00:07, A4 is 0:00:15, I put the SUM formula where I want the total to be, but it does not add A2 through A4 and only shows 0:00:00.)

    Once the formula is in place, if I double click the A cells that have time in them and hit enter, then and only then will it add the data.

    How do I get this to automatically add the data when times are added in the A column?

    1. Hi! I cannot help you check how your custom function works, which I don't have. We do not help with the creation of custom functions, and we do not give advice on how to work with VBA.

  7. I'm trying to add seconds to a starting time that's a negative value (say, A2='-0:20:00) but =A2+TIME(0,0,31) is not working even though I went and changed to 1904 date format in advanced options. Where should I go from here? I want negative time before a catalyst event at time=0:00:00. Then see values from 0:00:00, 0:00:30 all the way to 1:20:00 at 30 second intervals.

    1. Hi! You cannot enter a negative time in a cell. But you can get a negative time in the 1904 date format using a formula like this:

      =0-TIME(0,0,20)
      or
      =0-A2
      where A2=0:0:20

  8. hi there. my question is let say

    10434:34 which is 10434hours and 34minutes + 214:53 which is 214hours and 53minutes
    how to create the formula. since i try but my answer is VALUE.

    please guide me. thank you

  9. hi ,
    =(C1+D1)-(A1+B1)
    i am using this formula for calculating hours. but this formula only for less than 24 hours , how can i use this same formula for more than 24 hours
    thank you

  10. Howa to calculate the repetition of hours 8 and 12 bitween two dates ex: 15/02/2024 and 18/02/2024
    Thank you.

    1. Hi! If you have a range of date and time values, you can use the HOUR function to extract the number of hours in the range. You can then use the SUMPRODUCT function to count the number of hours that is equal to 8. For example:

      =SUMPRODUCT(--(HOUR(A1:A15)=8))

      I hope my advice will help you solve your task.

  11. Hi, I am trying to figure out an average clock-in time on different days.

    Say,

    Day 1: 07:00
    Day 2: 08:00
    Day 3: 06:00
    Day 4: 06:30
    Day 5: 07:00

    I would to know the formula that will tell me the average time the employee clocked in over the 5 days.

    Thanks.

  12. Hi, I am creating a schedule tracker for teammates in excel. When I write the shifts per employee, I utilize one box per day per teammate. So under Teammate "Zach" in box 1 it will say 4:00-13:00, box 2- 4:00-12:00, and box 3- 4:30-16:30. Is there a way to sum the total number of hours for all those days in each box?

  13. I am trying to create a timesheet that automatically calculates the amount of time between 4 times, adding the hours worked and subtracting the lunch time. From there I need 8 hours or less to populate under "regular hours" column, and any overage to calculate under OT hours. I tried to do a sumif and tell it to calculate the hours and minutes, which it did, but it won't accept me telling it to put 8 if it sums to more than 8 hours.Day In

    IN out for lunch OUT Reg OT
    Monday 6:30:00 AM 11:00:00 AM 11:30:00 AM 5:00:00 PM 8.00 2.00
    Tuesday 6:30:00 AM 11:00:00 AM 11:30:00 AM 5:00:00 PM 8.00 2.00
    Wednesday 6:30:00 AM 11:00:00 AM 11:30:00 AM 5:00:00 PM 8.00 2.00
    Thursday 6:30:00 AM 11:00:00 AM 11:30:00 AM 5:30:00 PM 8.00 2.50
    Friday 6:30:00 AM 11:00:00 AM 11:30:00 AM 6:00:00 PM 8.00 3.00
    Saturday 6:30:00 AM 11:00:00 AM 11:30:00 AM 4:45:00 PM 9.75

  14. Can you please make me formula to reflect below answers YES and NO as per these times

    carryover
    8/30/2023 21:59 8/31/2023 8:00 yes
    8/30/2023 21:59 8/31/2023 0:00 yes
    8/30/2023 21:59 8/30/2023 23:59 no
    8/30/2023 22:00 8/30/2023 23:59 no
    8/30/2023 22:00 8/31/2023 23:59 no

    1. Hi! I don't want to guess by what logic you set Yes or No. Also, it is unknown if the date and time are written in the same cell or if they are 2 separate values.

  15. Hello
    I am needing help try to make a formula to help me with employees time.
    For instance they start at 5:00 AM normally but if they are late (After 5:02 their time doesn't start until 5:15). Also if they clock out before the next quarter hour say 2:40 PM it is rounded down to 2:30 and minus lunch time of 30 minutes daily. I am trying to do this without having to write out the date in the formula as I'm just double checking their math on each individual day i.e. start time A1 end time A2 lunch A3.

  16. Hi.
    I'm working on my work sheet with all kinds of shifts. My shifts can start at any time of day and also end in any time. Of the sime day or next day.
    B4=start date
    D4=start time
    E4=end date
    F4=end time

    I can calculate length of shift, break, day hours but I can't calculate night hours which are only between 22:00 to 6:00 next day.

    As example, cases can be:
    1. Shift starts 1.1.2024 at 18:00 (6:00PM) and ends 2.1.2024 at 2:00 (2:00AM);
    2. Shift starts 1.1.2024 at 0:00 (12:00AM) and ends 1.1.2024 at 8:00 (8:00AM);
    3. Shift starts 1.1.2024 at 23:00 (11:00PM) and ends 2.1.2024 at 7:00 (7:00AM);
    4. Shift starts 1.1.2024 at 6:00 (6:00AM) and ends 1.1.2024 at 14:00 (2:00PM);
    5. Shift starts 1.1.2024 at 16:00 (4:00PM) and ends 2.1.2024 at 0:00 (12:00AM);
    6. Shift starts 1.1.2023 at 15:00 (3:00PM) and ends 1.1.2024 at 23:00 (11:00PM);
    7. Shift starts 2.1.2024 at 0:00 (12:00AM) and ends 2.1.2024 at 7:00 (AM);
    8. Shift starts 1.1.2024 at 23:00 (11:00PM) and ends 2.1.2024 at 4:00 (AM).

    Can somebody help me with formula to count only night hours?

    1. Hi! To calculate night hours at 10:00PM and ends 6:00AM, try this SUMPRODUCT formula:

      =SUMPRODUCT((ROW($1:$360)>MOD($D4,1)*1441) * ((ROW($1:$360)<(MOD($F4,1)*1441+(TRUNC($F4)>TRUNC($D4))*1440)))) / 1440+SUMPRODUCT((ROW($1321:$1800)>MOD($D4,1)*1441) * ((ROW($1321:$1800)<(MOD($F4,1)*1441 + (TRUNC($F4)>TRUNC($D4))*1440))))/1440 + SUMPRODUCT((ROW($2761:$3000)>MOD($D4,1)*1441) * ((ROW($2761:$3000)<(MOD($F4,1)*1441+(TRUNC($F4)>TRUNC($D4))*1440))))/1440

  17. Hi,

    I have these 2 time stamps. the sum of working hours is over 24h.

    11/1/2023 7:33:46
    11/2/2023 8:55:07

    To calculate total hours I use formula: WORKDAY(F1,H1)+MOD(H1-F1,-1) but then if it is over 24h it calculates as 1:21:21

    Help to fix this is appriciated.

    Thank you!

  18. Hi there,
    i'm creating sheet to calculate working hours for my employee ,we have shift timing of 8:30 am to 8:00 PM ,but punching time would vary for each persons ,i have constraint in minusing lunch break,if the person is working from 8:30 am to 1: 30 pm or 2:00 pm to 8:00 pm there wont be lunch break , so i need formula that helps me to calculate exact working hours

  19. 29-09-2023 12:20
    30-09-2023 15:35

    need difference from end date to start date

  20. Hi, I am looking for a formula to calculate hours worked (end time-start time), but also to subtract 30 minutes if cell B isn't blank. So basically if there is a value in cell B, then subtract 30 minutes from the total time worked. Otherwise, if cell B is blank then don't subtract 30 mins.

    1. I think I figured it out:
      =IF(ISBLANK(B2), C2-A2, C2-A2-TIME(0, 30, 0))

  21. Hello, I have a problem I cannot wrap my head around. I need to calculate overtime (time worked over 8 hours) that happened at night (between 22:00 and 6:00) and separately overtime that happened during the day.
    I have start of the work (I6), end of the work (J6), total time worked (K6), total overtime (L6) and how much time I worked during the night (O6).
    I want to calculate specifically how many overtime hours happened during the night and how many happened during the day.
    Thanks for any help.

    1. Hi! If I understand your task correctly, try the following formulas:
      Day overtime:
      =IF(M6>0,IF(L6>M6,L6-M6,0),L6)
      Night overtime:
      =L6-O6

      1. Hey! Thanks a lot for an answer. As much as I like simplicity of this solution (and I got really excited to see it working), it doesn't work for all the cases. For example starting work at 9PM and working until 9AM shows 4 night OT hours, but it should be 1 night OT hour and 3 day OT hours.

        1. For those interested: Formulas that ended up working for me in all the cases were:
          Day overtime (M6);
          =IF(I6<=J6,MIN(L6,MAX(0,"22:00"-I6-"8:00")),MIN(L6,MAX(0,J6-"06:00")+MAX("22:00"-(I6+"8:00"),0)))
          Night overtime(N6):
          =L6-M6
          And no, I didn't think of that myself x)

  22. I need help regarding my formula.
    cell B3: 1/5/2023 18:38
    cell C3: 1/5/2023 18:47
    cell D3: 0 days, 0 hours, 9 minutes, and then the result for cell E3: Failed,
    but the formula for cell E3 is =IFERROR(IF(D3<="0 days 0 hours 15 mins","Passed","Failed"),""
    formula for D3 is =IFERROR(INT(C3-B3)& "days" & HOUR(C3-B3)& "hrs" & MINUTE(C3-B3)& "mins","")
    The format for cells B3 and C3 is custom "mm/dd/yyyy hh:mm."
    should be the correct result for cell E3 is passed if the formula is less than 15 minutes.

    1. Hi! There is a text in cell D3. You cannot do any mathematical operations on the text, and you cannot do comparisons < and >. Try this formula:

      =IFERROR(IF(C3-B3<=TIME(0,15,0),"Passed","Failed"),"")

  23. Hi
    So let's just say I have data in C:C
    All data is represented as h:m:ss AM/PM based on a form
    eg. 1:58 AM, 3:20PM, 2:23PM, 2:39PM.... the list goes on
    How do I count the hour and any minute associated during the AM/PM

    eg. (1) 1AM
    (1) 3PM
    (2) 2PM

    I have used =COUNTIF(C:C,"="&TIME(12,0,0))
    to check the total pm

    However I was experimenting with those formulas and I've gotten close to it but when proof checking it's not giving me the accurate data per hours

    Please feel free to help/ correct me
    Thank you in advance

  24. Hello,

    I want to find the STARTING CLOCK time for a sequence of tasks where I know and can enter the DURATION time of the needed tasks.

    I do simple subtraction of durations from one column and Excel is correclty displaying the correct startging CLOCK time in another column, but the moment a duration puss the clock backwards past midnight it breaks and shows a line of #######

    Any suggestions?

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

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

  25. I'm trying to calculate the decimal hours and minutes worked when the shift starts at 10:00am an goes through to 2:00am the following morning
    This is what I get:-
    Open Hours
    A B (B-A) =C
    Open Close Hours ON /Day
    10:00 2:00 -8.0 hrs

    Is there a formulae that will show the correct decimal hrs:mm worked when spanning 2 days. (I am not concerned about the days) and jusst enter the hours and sec using as time filter eg 10:30
    Open Hours
    A B C=?
    Open Close Hours ON /Day
    10:00 2:00 16.0 hrs

  26. Hello

    I am working on a timesheet for staff and I am looking for a way to calculate how much time is spent working after 8pm if someone works that long. It would be in hh:mm.

    1. Hi! If I understand your task correctly, try the following formula:

      =IF(A1>TIME(20,0,0),A1-TIME(20,0,0),0)

      Use the TIME function to set 8PM, and the IF function to find the difference if the end time of A1 is greater than 8PM.

  27. I am trying to use Excel 2007 to identify and display fastest times for each stroke, distance, and course (yards/meters) from a sheet with multiple meets, each with multiple strokes and distances, courses and times (formatted in min:seconds:hundredths (mm:ss:00)). I hoped to use Min(IF with an array function but can' get it to work. The function looks like this: (in a different version I used = instead of commas)

    {=MIN(IF(D4:D100,D4,IF(E4:E100,E4,IF(F4:F100, F7,IF(F4:F100,F4,G4:G100)))))}

    Where D = stroke (Free, Back, Breast, etc.) , E = Event distance (50, 100, 200, etc., F= course (yards or meters), and G = times achieved in minutes,seconds, and hundredths or seconds and hundredths where applicable.

    The result I keep getting is 0:00.00 instead of the fastest time.

    I'll have separate functions for each combination of stroke, distance, course. Ideally, I would like to grab the data from a separate sheet where I enter meet results but that is the least of my problems

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

      =MIN(IF((($D$4:$D$10=D4)*($E$4:$E$10=E4)*($F$4:$F$10=F4)*G4:G10)>0, (($D$4:$D$10=D4)*($E$4:$E$10=E4)*($F$4:$F$10=F4)*G4:G10), ""))

      In your Excel, you need to enter this formula as an array formula.

      1. Thanks!

        I haven't tried your version yet to see how it differs, but think by using TIMEVALUE I was able to omit the the first expression. I stumbled on my version after hours searching the web and experimenting before I saw yours. (As you can see, my data is on a separate sheet named Log.)

        {=MIN(IF(Log!$D$4:$D$39=Log!$D$5,IF(Log!$E$4:$E$39=Log!$E$7,IF(Log!$F$4:$F$39=Log!$F$4,TIMEVALUE(Log!$G$4:$G$39)))))}

        My next problem is how to automatically retrieve the date of the fastest time so it displays on my summary sheet . I entered dates into the Log as M/DD/YYYY and formatted to display as dd:MMM:YYYY. I used a single leading quotation mark to prevent the time from changing to a date when I click on it and to suppress the leading zero.

        I tried using a modified version of the min. time function, but that returned the oldest (smallest) date in the range : ~ ) then I tried using a couple of simple IF formulas: IF( G - B = 0) , B = G, etc. they all returned either "False" or "Value" I think my problem is with TIME formatting

  28. My job keeps a running total of time hours and minutes. For example my running total 2 months ago was 1410:51, last month my total was 1486:33. How do I find the difference between the 2 without excel converting it to days?

    1. You will want to set the number format to the following: [h]:mm which will show as 75:42

      If you leave out the square brackets around the H, then it will show the time as an hour on a clock instead of the total hours. That will show as 3:42.

      To change the format go to Home > Number then click the little arrow in the bottom right. In the left box click "Custom" then type in your custom number format.

  29. I am trying to calculate my time throughout the day which includes a clocked in and out break. But with my formula it is showing what should just be an 8.30 day worked as 8.50. How do I fix this?

  30. Hi Alexander Trifuntov/Ablebits Team.
    I Currently have a column with the data of time elapsed for cars parking in a parking lot. format 00:00:00 H:M:S
    i created the column using this formula =text(P665-L665-int(P665-L665),"HH:MM:SS")
    and then formatted the column with the basic format function into Format>Number>Duration

    i am trying to count the frequency that the time elapsed is over 2 hours (02:00:00). meaning the number of times a vehicle stayed longer than 2 hours.

    any assistance would eb deeply appreciated

  31. Hi! I am needing to calculate an arrival time for a surgical unit. We use the Time of surgery (in 24hr time) + duration of surgery (in minutes) + 1hour for recovery. I'd like to program this calculation into a spreadsheet that we can use for patient flow. Ex. surgery time 0830, duration of 120 minutes + 60 minutes of recovery = arrival time of noon (1130). How can I write a formula to make these conversions properly?
    Thank you!
    Karin

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

      =A1+(120+60)/1440

      A1 - surgery time

  32. I am trying to figure out a formula for our time sheets. We have the work hours, that isn't the issue. My problem is converting the work hours to clock hours. For example someone works 7:30 hours, that is how we get it I have to then convert it to 7.50 to figure payroll. Does that make since what I am asking. Example of what we do
    5/15/2023 1:15 PM 3:14 PM 1:59 1.98
    Date clock in clock out hours worked I convert this manually looking for a way to automatically do this
    Thank you

  33. Hello, I am trying to subtract overtime hours from regular hours that are on 2 different cells but I keep getting #VALUE error

    Example: In cell A2 I have [42]:15 for total worked hours and in cell B2 I have [40]:00 for regular work hours
    The difference would be =A2-B2 to get a total of [2]:15, meaning 2 hours and 15 mins of overtime but I keep getting #value error.

    note: I am not working with date or time formats I would say, since they are hours worked, not time of the day

    I would appreciate your response

  34. Hi, my organisation requires we complete our time sheets using excel. The date is selected via a drop down menu where it then automatically populates the next field with the actual day. My big problem are the start and end times where the columns AM and PM columns are separated and once again are selected by a drop list where either AM or PM can be selected. We are paid from start to end time over that 24 hour day minus the number of hours we actually slept during that overnight shift, In the next column after sleep time, I want to input the required formula to provide the number of hours accumulated as awake, (start to End on the following day) minus the sleep time. How would this be done noting I can't change the existing spreadsheet layout and only add the additional column after sleep time with my own calculations. Thanks

    Date SHIFT Client Start End Shift Type Sleep Time
    12/04/2023 Wednesday ACA Bob 10.45 AM 9.00 AM Day Shift 11pm to 6am
    13/04/2023 Thursday ACA Bob 9.00 AM 9.00 AM Sleepover 11.45pm to 6am
    14/04/2023 Friday ACA Bob 9.00 AM 9.00 AM Sleepover 11pm to 6am

    1. Hi! You can calculate the number of hours like this:
      (11pm - 10.45 AM) + (9.00 AM - 6am)
      I can't give you the formula because I don't know what cells your data are written in.
      If this does not help, explain the problem in detail.

  35. Hello,

    so I am trying to make a timesheet for my employee. I have their start time and end time of work. when I try to calculate total time they worked using timevalue formula, it gives me result in time format.

    for example, I have start time on c2 which is 5:45am and end time on d2 which is 7:45am , so I am trying to calculate hrs he worked using formula, but end result is 2:00am.

    how can I just get a hrs in Number but not in a time format.

  36. I'm trying to sum a total of each individual who has worked for the entire week. I have a data that I have calculated the daily working hours but I am unable to get a total of the entire week.

  37. I'm trying to calculate the amount of time I worked down to the exact minute for the entire month, but when I try to sum it it just adds time to each other in a 24 hour format, starting me from 0 again after every 24 hours

  38. Is there a way to set up a formula to calculate the elapsed hours/minutes only during certain timeframes/days?

    I.e. We want to calculate elapsed time from order received to order sent out. But we only want the elapsed time to calculate from Monday - Friday 8am-4pm. So if an order comes in at 7pm on Monday night, we want the elapsed time to start calculating as of 8am on Tuesday and continuing to track business hours only until the order is sent out.

  39. Drives me nuts. I got time formatted in HH:mm:ss and I try to get the difference between two times in seconds. I always get the output mm:ss if I multiply it by 86400 I get zero.

    Another problem I've encountered is that =(B2-((-9,59)/(465)*125)) outputs a value error. I don't get any of this.

    1. Hello!
      Question 1: Try changing the cell format to General
      Question 2: Check the value in cell B2. Check the decimal separator. Probably correct 9.59 You don't need so many brackets. =B2-(-9.59/465*125)

  40. I am looking to scan a barcode in column A, that then produces the date and time it was scanned in column B. When I use the the formula =IF(A1="","",now()) in column B, and I scan a barcode into A1, the correct time comes up. now when the formula is copied down the column, B2 appears blank (as it should). Then when you scan a new barcode into A2 any amount of time later after the first time, the current time appears in B2 and B1 changes to the new current time.

    I need a formula to calculate the time of the scan in the adjacent cell, that doesn't change unless the adjacent cell changes.

    1. Hi
      I’m trying to create a roster that calculates hours worked and automatically subtracts non paid breaks
      For example if someone works 12pm-7pm it would be 7 hour in total but minus 1 hour for unpaid breaks so the excel sheet should show 6 hours instead of 7.
      I can get the formula to add the hours but not sure what formulas to use to minus unpaid breaks

      1. Hi! Subtract 1 hour from the time difference. For example, by using the TIME function:

        =End time - Start time - TIME(1,0,0)
        or
        =End time - Start time - 1/24

    2. Hi!
      You can use a VBA macro to replace the formula with the current time when you enter a value in another cell.

  41. Hello,

    I have a situation where I calculate the answering time, but I do not want to calculate the time outside of working hours.
    For example:

    Time of receiving e-mail: 02.02.2023. 15:50
    Time of receiving answer: 03.02.2023. 08:30
    I want the result to be: 40 minutes.

    How to do it?
    Thank you.

  42. working schedule /day- 8.00 am to 5.00 pm wherein 1.00 pm to 2.00 pm lunch back
    one project start work 26/1/2023 at 11.00 am.
    weekly holiday=27/1/2023
    weekly holiday=28/1/2023
    time required to complete project =43 hr.
    Finished date & time of the project=??
    need formula plz??

      1. hi,
        thanks
        Finished date & time =2/2/2023 at 11.00 am
        but manually calculation actual finished date & time should =2/2/2023 at 3.00 pm.

        start time=26/1/2023 at 11.00 am (wherein work schedule =8.00 am to 5.00 pm),

        need help for solution please.

  43. Status Date Time Hours
    Exit 27-Jan-23 4:58:14 AM
    Entry 27-Jan-23 3:25:33 PM
    Entry 27-Jan-23 3:25:49 PM

    how i can get hours above

  44. HI,
    I'm trying to get total hours worked but its coming up 12:00:00 AM
    I'm using the AutoSum option
    Thanks

  45. Hi, Found your tutorials very useful. Kindly help with the below task.

    I'm trying to prepare a weekday-wise task schedule, for item dispatching purposes.
    I require to view the time with WEEKDAY (ie: WED 15:30).
    Ex: If the dispatch day/time of delivery of one item, is WED 15:30, our preparation starts 36 hours prior, so at " Preparation Time" column should be displayed as " TUE 03:30", where I can analyze the hourly workload on each Day of Week.

    Thanks.

    1. Hello!
      To extract the time from a date, extract the fractional part of the number using the INT function.
      For example,

      =IF((A1-INT(A1))>TIME(15,30,0),A1-36/24,A1)

      I hope it’ll be helpful.

  46. Im trying to count timestamps i made with a macro essential enters now() if another cell is filled but i want to count the time stamps that fall into a range of 9am-12am 1pm-3pm and 3pm-5pm any idea how to format timestamps so i can use count ifs to determine if they are within those ranges?

    1. Hello!
      If your values contain time, count the number of values by two criteria using the COUNTIFS function:

      =COUNTIFS(A1:A15,">09:00",A1:A15,"<12:00")

      I hope my advice will help you solve your task.

  47. Anyone have an idea how I can compute for cycle time? But only taking into account a specific timeframe.

    Example:
    Timeframe is 9:00AM to 5:00PM
    But the device was assembled with times:
    8:00AM-12:00NN
    3:00AM-7:00AM
    2:00PM-7:00PM

    Is there a formula where I can compute for the cycle time but only for 9:00AM-5:00PM time?

  48. Hi, I need your help.

    How to get the Duration time if this is the format?
    DATE TIME DURATION LOGIN TIME LOGOUT TIME
    30-Aug 01:00 PM - 10:00 PM 9:00:00 8/30/2017 13:00 8/30/2017 22:00

    I really need an answer for this. Thank you so much ♥

    1. DATE-----------T------IME-------------------------- DURATION---------------- LOGIN TIME ----------------------LOGOUT TIME
      30-Aug------01:00 PM - 10:00 PM------- --------9:00:00 --------------------8/30/2017 13:00--------------- 8/30/2017 22:00

      This one. I need the formula for this. Thanks!

  49. Hi Guys...how do you convert two times into hours and minutes..

    Example

    6:00 am --start time
    8:30 --- end time

    Answer is 2.50 where the 50 is the 30 minutes divided by 60 (30/60)

    Need the formulae to work on various time differences like this

      1. Thank you as this was extremely helpful

  50. I know the start time 7:41 AM, I know the time out for lunch, 11:38 AM, I know when the time clocked back in after lunch 12:16 PM.
    The person has to work 8 hours. I need to calculate the ending time based off the three known times and the total duration of 8 hours.
    What is the formula for calculating the ending time?

    1. =TIME(8,0,0)-((Lunch Start - Start Time) + (Lunch End - Lunch Start))

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

      =8/24+A1+(A3-A2)

      A1 -start time A2 and A3 - lunch time

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 :)