+ Reply to Thread
Results 1 to 3 of 3

Minimum time between two times

  1. #1
    Valued Forum Contributor
    Join Date
    03-17-2012
    Location
    Warsaw, Poland
    MS-Off Ver
    2007/2010
    Posts
    555

    Minimum time between two times

    Hi all,

    cut to the chase: I have a column with timeframes:

    12:30 - 19:00
    09:00 - 18:00
    11:15 - 15:30
    05:00 - 00:00

    Sometimes theres a textstring "Off" inbetween those times. Is there a easy way to get the minimum time between such cells? I tried the following:

    Please Login or Register  to view this content.
    The problem with that is, that if a cell ends with 00:00 the subtraction is negative and thus the minimum. I had to throw in a "IFERROR" statement in there since those "Off's" return #Value instead.

    Thanks
    If you think that my answer was helpful, please click on the "Add to this user's Reputation" button.

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: Minimum time between two times

    If you absolute the arithmetic it will always return a positive number

    Try this

    =MIN(ABS(TIME(MID(G4:G124,9,2),MID(G4:G124,12,2),0)-TIME(LEFT(G4:G124,2),MID(G4:G124,4,2),0)))
    Elegant Simplicity............. Not Always

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Minimum time between two times

    How about showing a few examples and tell us what results you expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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