+ Reply to Thread
Results 1 to 2 of 2

Times and midnight issues

Hybrid View

  1. #1
    Registered User
    Join Date
    12-08-2007
    Posts
    1

    Red face Times and midnight issues

    My problem is that I have a target time of 23:00 and I need to calculate how many minutes the actual time is late or early.

    For the early I’m happy to get a zero output if minuses cannot be displayed.

    The problem is that the actual time could be before the target time or after and also going past midnight.

    I can get to zero or a calculated time even if passing midnight but as soon as the actual time is 1hr before the target time I get 23 hours and it needs to be either minus or zero.

    =B2-A2+(A2>B2) [this works fine until the actual time is before the target time]

    Anyone help please, and an explanation if possible of the work around.

    Bslob

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    If 11PM is in A1, this will return the difference between the time in B1 and 11PM

    =B1-A1+(B1-A1<-0.5)

    with the custom format of [m]
    12:02 AM returns 62
    10:45 PM returns -15

+ 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