+ Reply to Thread
Results 1 to 7 of 7

Formula with 24 hour clock and calculating over 24 hours

  1. #1
    Registered User
    Join Date
    10-24-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    4

    Formula with 24 hour clock and calculating over 24 hours

    Good afternoon everyone.
    Hi am having difficultly with this formula and I think it is probably easier than I am making it in my brain.
    We essentially run jobs that start late at night. I need to calculate if the job met it's expected time....easy right?
    so if the job ends at 1:26:55 and the expected is 1:30:00 it passes so the formula looks like this
    =if(B2<=C2,"Pass","Fail")
    however when the "clock" starts over I get an invalid function...for example
    job ends at 23:59:10 and expected is 1:30:00 the same formula gives me a fail because it didn't recognize that is happened 2 hours early.
    I need an IF or AND statement that helps it recognize that the job completed the day before....oh and to make it more fun I don't have dates...when the report was written it was just expected that all jobs would complete in the same 12 hour period.

    Thanks in advance..
    Michelle

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Formula with 24 hour clock and calculating over 24 hours

    Do you have a start time for the job or any other information?
    Audere est facere

  3. #3
    Registered User
    Join Date
    10-24-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula with 24 hour clock and calculating over 24 hours

    no...only Finish and expected finish

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Formula with 24 hour clock and calculating over 24 hours

    In that case I think you'd have to make some sort of assumption because time is, of course, circular so why can't 23:59 be after 01:30 (if it was 23:59 the next day)?

    ....but presumably that's unlikely - do all jobs start "late at night" - what time period might that be (could they start after midnight)? What's the latest that a job could finish?

  5. #5
    Registered User
    Join Date
    10-24-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula with 24 hour clock and calculating over 24 hours

    Hi again!
    All the jobs start after 7pm and finish when they finish. usually between 5-12 hours

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,699

    Re: Formula with 24 hour clock and calculating over 24 hours

    OK try using this formula

    =IF(MOD(B2-19/24,1)<=MOD(C2-19/24,1),"Pass","Fail")

    That will work for the examples you gave

  7. #7
    Registered User
    Join Date
    10-24-2013
    Location
    Phoenix
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Formula with 24 hour clock and calculating over 24 hours

    Great job....thanks for all your help

+ 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. Replies: 1
    Last Post: 07-03-2015, 06:57 AM
  2. [SOLVED] Calculating time on site from a 24 hour clock
    By jatacake in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 03-11-2013, 06:36 AM
  3. Default time from 12 hour clock to 24 hour clock
    By MR-77 in forum Excel General
    Replies: 3
    Last Post: 03-31-2011, 04:15 PM
  4. 24 hour clock calculating total hours using midnight
    By Wilgoss in forum Excel General
    Replies: 8
    Last Post: 09-06-2010, 11:53 AM
  5. Calculating hours w/ ½ hour break
    By Three21Kobe in forum Excel General
    Replies: 7
    Last Post: 08-14-2010, 04:21 AM

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