+ Reply to Thread
Results 1 to 8 of 8

In need of an excel formula to calculate the diff in times but only between specific times

  1. #1
    Registered User
    Join Date
    04-08-2014
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    4

    In need of an excel formula to calculate the diff in times but only between specific times

    Good morning everyone, I'm looking for a formula that will calculate the difference in times between specific times while working with a 24 hr clock. Please see details below:

    E3 provides the start time of 4:00
    H3 provides an end time of 15:30

    If an employee works betwen the hours of 0:00 (midnight) to 5:59, this is considered DIFF hours and is therefore the number I am seaking. So for the data noted above, the total DIFF hours worked is 2 hours.

    Thank you in advance for your time!

  2. #2
    Registered User
    Join Date
    04-07-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: In need of an excel formula to calculate the diff in times but only between specific t

    Here you go, this also assume instances of a start and end time between 0:00 (midnight) to 5:59

    Please Login or Register  to view this content.
    Click * Add Reputation if this response helps!

  3. #3
    Registered User
    Join Date
    04-08-2014
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: In need of an excel formula to calculate the diff in times but only between specific t

    Thank you so much for the quick reply! The only issue is that if the statement is false (if the employee began work at 6:00 and ended at 14:00) I would like the total to be "0" - Would I add this in the formula as noted below?

    =IF(AND(H3<TIME(6,0,0),E3>TIME(0,0,0),E3<H3),H3-E3,IF(E3<TIME(6,0,0),TIME(6,0,0)-E3,IF(H3>TIME(0,0,0),H3-TIME(0,0,0),"0")))

  4. #4
    Registered User
    Join Date
    04-07-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: In need of an excel formula to calculate the diff in times but only between specific t

    Here you go

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    04-08-2014
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: In need of an excel formula to calculate the diff in times but only between specific t

    Thank you so much! One last question (I promise). If cell E3 or H3 have no data, the most recent formula gives a total of 6:00.. is there a way to fix this to show 0?

  6. #6
    Registered User
    Join Date
    04-07-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: In need of an excel formula to calculate the diff in times but only between specific t

    Feel free to discuss, if this didn't fix your problem
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    04-08-2014
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: In need of an excel formula to calculate the diff in times but only between specific t

    That's EXACTLY what I needed! Thank you sooo much

  8. #8
    Registered User
    Join Date
    04-07-2014
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: In need of an excel formula to calculate the diff in times but only between specific t

    Since you received a resolution, could you please mark this thread as SOLVED from the Thread Tools at the beginning of this thread?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. SLA Response Formula for 2 diff SLA times
    By DoodlesMama in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-11-2013, 07:08 PM
  2. If a search term can be found 1 time, 2 times 3 times 4 times 5 times
    By excelcandy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-10-2013, 09:57 PM
  3. [SOLVED] calculate turn around times range of times for weekday and weekend
    By xrayexceller in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-28-2013, 02:22 PM
  4. Replies: 0
    Last Post: 11-14-2011, 05:40 PM
  5. Macro Loop – Find Specific Times, Extract Date, Average Values of Times
    By ExcelQuestFL in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-25-2010, 02:50 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1