+ Reply to Thread
Results 1 to 15 of 15

calculating total hours between dates

  1. #1
    Registered User
    Join Date
    04-10-2007
    Posts
    10

    calculating total hours between dates

    I need to calculate time taken to fix a piece of equipment.

    A1 B1
    BREAK TIME FIX TIME
    4/22/08 23:00 4/23/08 04:00

    Should be 5 hours, but i can't find the formula to make it work.

    Thanks, as always.

    cc

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    Just take one from the other and format the result to TIME

    =B1-A1
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    It's just =B1-A1 and formatted as time.

  4. #4
    Registered User
    Join Date
    04-10-2007
    Posts
    10
    it doesn't work if it's over 24 hours.
    4/22/08 01:00 (break)
    4/24/08 15:00 (fix)
    the simple subtract formula is coming up 14:00

  5. #5
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    OK,

    Custom format to [hh]:mm

  6. #6
    Registered User
    Join Date
    04-10-2007
    Posts
    10
    Thanks much, that was the missing link for me.

  7. #7
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    No problem - glad to help

  8. #8
    Registered User
    Join Date
    04-10-2007
    Posts
    10

    ...and furthermore

    Now for the next step in this formula.

    I have a formula to report a fix rate:
    fixed within 12 hours / number of breaks

    i need a countif that will find the number of breaks fixed within 12 hours but will not include the no value cells. (essentially anything in the column that is >00:01 and <=12:00

    Thanks again,

    cc

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    =B1 - A1 - SUM(breakRange)

  10. #10
    Registered User
    Join Date
    04-10-2007
    Posts
    10
    That won't get it, i'll be more specific:

    A1
    00:00
    00:00
    01:15
    14:00
    02:00
    12:00
    18:00
    00:00

    The returned value in this example would be 3. (3 times greater than 00:00, <= 12:00)

    Thanks

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    =SUMIF(A1:A8, "<=0.5") returns 15:15 (1:15 + 2:00 + 12:00)

    =SUMIF(A1:A8, "<0.5") returns 3:15.

  12. #12
    Registered User
    Join Date
    04-10-2007
    Posts
    10
    Right, but i need a count, not a sum. This column indicates the time it took to fix an airplane after a break, but each row is a flight, so there won't always be breaks, therefore fixes. I need to report on how many fixes were accomplished in under 12 hours.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I'm losing the bubble here ...

    =COUNTIF(A1:A8, "<=0.5")

  14. #14
    Registered User
    Join Date
    04-10-2007
    Posts
    10
    we're getting closer...

    that countif doesn't exclude the 00:00. Is there a way to do something like this:

    =COUNTIF(A1:A8, "<=0.5") AND ...>.01 so that it won't count the 00:00 values?

  15. #15
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    You can either use 2 COUNTIFS, i.e.

    =COUNTIF(A1:A8, "<=0.5")-COUNTIF(A1:A8,0)

    or SUMPRODUCT, i.e.

    =SUMPRODUCT((A1:A8>0)*(A1:A8<=0.5))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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