+ Reply to Thread
Results 1 to 9 of 9

Maximum and Minimum Time Value in a Range

  1. #1
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Maximum and Minimum Time Value in a Range

    I have used max and min function to display minimum and maximum time value; however, it is not displaying the correct time value from the list. I think there is a better formula to achieve this. From the sample data displayed below, minimum time value should be 11:30PM and maximum time value should be 6:30AM

    See sample data below:
    4/1/2013 11:45 PM
    4/1/2013 11:30 PM
    4/2/2013 6:30 AM
    4/2/2013 6:15 AM
    4/2/2013 6:00 AM
    4/2/2013 5:45 AM
    4/2/2013 5:30 AM
    4/2/2013 1:30 AM
    4/2/2013 1:15 AM
    4/2/2013 1:00 AM
    4/2/2013 12:45 AM
    4/2/2013 12:30 AM
    4/2/2013 12:15 AM
    4/2/2013 12:00 AM
    Last edited by bjnockle; 05-17-2014 at 09:20 AM.

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

    Re: Maximum and Minimum Time Value in a Range

    Mmmm. Don't you need a date field too??? Otherwise, how is Excel meant to know that it is either a) earlier that day or b) early the following day? Maybe I'm being htick, as Excels way of handling dates and times has always felt like a bit of a dark art...
    Last edited by Glenn Kennedy; 05-17-2014 at 09:18 AM.
    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.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  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: Maximum and Minimum Time Value in a Range

    Try this...

    Data Range
    A
    B
    C
    D
    1
    ------
    ------
    ------
    ------
    2
    4/1/2013 11:45 PM
    Min
    11:30 PM
    3
    4/1/2013 11:30 PM
    Max
    6:30 AM
    4
    4/2/2013 6:30 AM
    5
    4/2/2013 6:15 AM
    6
    4/2/2013 6:00 AM
    7
    4/2/2013 5:45 AM
    8
    4/2/2013 5:30 AM
    9
    4/2/2013 1:30 AM
    10
    4/2/2013 1:15 AM
    11
    4/2/2013 1:00 AM
    12
    4/2/2013 12:45 AM
    13
    4/2/2013 12:30 AM
    14
    4/2/2013 12:15 AM
    15
    4/2/2013 12:00 AM
    16


    D2: =MOD(MIN(A2:A15),1)
    D3: =MOD(MAX(A2:A15),1)

    Format as Time
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Maximum and Minimum Time Value in a Range

    Tony - your formula works like a charm. What is the dates are the same? Is there a way to get around this? See sample data:

    2 4/1/2013 11:45:00 PM
    3 4/1/2013 11:30:00 PM
    4 4/1/2013 6:30:00 AM
    5 4/1/2013 6:15:00 AM
    6 4/1/2013 6:00:00 AM
    7 4/1/2013 5:45:00 AM
    8 4/1/2013 5:30:00 AM
    9 4/1/2013 1:30:00 AM
    10 4/1/2013 1:15:00 AM
    11 4/1/2013 1:00:00 AM
    12 4/1/2013 12:45:00 AM
    13 4/1/2013 12:30:00 AM
    14 4/1/2013 12:15:00 AM
    15 4/1/2013 12:00:00 AM

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

    Re: Maximum and Minimum Time Value in a Range

    If the dates are all the same then what results do you expect?

  6. #6
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Maximum and Minimum Time Value in a Range

    Same result for maximum and minimum time. Thanks

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

    Re: Maximum and Minimum Time Value in a Range

    Quote Originally Posted by bjnockle View Post
    Same result for maximum and minimum time. Thanks
    That's what I was afraid of!

    Explain the logic of how 11:30:00 PM is the min value and 6:30:00 AM is the max value.

    When the dates are all the same it seems that the expected results are the opposite of the actual true values.

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

    Re: Maximum and Minimum Time Value in a Range

    OK, The OP's edit added the date field, as I suggested, but I am also stumped as to how 06:30 can be the maximum time, when the same data range (all on the same day) also contains 23:45.

    bjnockle - can you explain????

  9. #9
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Maximum and Minimum Time Value in a Range

    Quote Originally Posted by Glenn Kennedy View Post
    OK, The OP's edit added the date field, as I suggested, but I am also stumped as to how 06:30 can be the maximum time, when the same data range (all on the same day) also contains 23:45.

    bjnockle - can you explain????
    Glenn: I experienced a similar issue with the dates being the same. The results returned is correct for the maximum and minimum value since the dates are the same. However, I was think if there is a way to trick Excel.

    Thank you.

+ 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. [SOLVED] Getting the maximum & Minimum value in a range
    By Navin Agrawal in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-13-2013, 12:39 PM
  2. [SOLVED] Getting minimum and maximum dates from a variable length range
    By ianbhenderson73 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-13-2013, 12:25 PM
  3. [SOLVED] Get Maximum and Minimum Value from a range of cells that contains certain values
    By jotol in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-28-2013, 10:33 PM
  4. Adding date/time to minimum and maximum flow values
    By junglefighter25 in forum Excel General
    Replies: 2
    Last Post: 07-06-2012, 07:28 PM
  5. [SOLVED] Automatic formatting of minimum/maximum value in a range.
    By Manish Kumar in forum Excel General
    Replies: 3
    Last Post: 03-05-2005, 03:06 PM

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