+ Reply to Thread
Results 1 to 10 of 10

Working out times over midnight with a twist

Hybrid View

  1. #1
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Working out times over midnight with a twist

    Hi there, try this:

    =IF(AND(A2=C2,D2<B2),0,MOD(D2-B2,1))
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

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

    Re: Working out times over midnight with a twist

    Quote Originally Posted by Glenn Kennedy View Post
    =IF(AND(A2=C2,D2<B2),0,MOD(D2-B2,1))
    Surely this won't work as required if allocated time is just before midnight one day and request time just after midnight the next?

    As you have the dates as well as the times you don't really need to use MOD, the time difference is just the allocated time/date minus the requested time/date, so this formula will give you that with MAX used to ensure you get zero when the allocated time/date is before the requested time/date

    =MAX(0,D2+C2-B2-A2)
    Audere est facere

+ 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. Average of Times Spanning Midnight
    By LJenny in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-24-2015, 10:44 AM
  2. [SOLVED] Difference between two times - avoiding ###### for times that span midnight
    By Abarency in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-07-2015, 01:15 PM
  3. Trying to calculate +/- min for actual times before and after midnight
    By WTFCanucks in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 11-11-2014, 12:08 PM
  4. Graphing completion times across midnight
    By wrudiger in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 06-28-2013, 03:18 PM
  5. difference between times not working for after midnight.
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-28-2013, 01:47 AM
  6. Median of Two Times Over Midnight
    By melissaallen5 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-11-2012, 12:56 AM
  7. Times and midnight issues
    By bslob in forum Excel General
    Replies: 1
    Last Post: 12-08-2007, 01:36 AM

Tags for this Thread

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