+ Reply to Thread
Results 1 to 4 of 4

Thread: Min and Max for 2nd shift times

  1. #1
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    PA
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    926

    Min and Max for 2nd shift times

    Hi, Trying to get the min and max times for a list of times. This seems to work great on 1st shift, however on second shift they are all messed up.

    I included a sample workbook to show my problem.

    Can someone advise how to get the min and max from the times listed in col A. I guess it has to do with times before and after midnight

    1st shift works 5am to 3:30 somtimes 5 pm m-f
    2nd shift works 3:30 to 2am sometime 4 am m-f


    Thanks as always, Mike
    Attached Files Attached Files
    Last edited by realniceguy5000; 02-09-2012 at 09:32 AM.

  2. #2
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,953

    Re: Min and Max for 2nd shift times

    Hi Mike,

    Try these array formulas for second shift (confirmed with CTRL+SHIFT+ENTER):

    =MIN(IF(A2:A270>=TIME(15,30,0),A2:A270))

    =MAX(IF(A2:A270<TIME(5,0,0),A2:A270))

    This will get the minimum time value starting at 15:30 (3:30pm), and the maximum time value earlier than 5:00am respectively. Format the cells as Time.

  3. #3
    Valued Forum Contributor Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens Greece
    MS-Off Ver
    Excel 2003
    Posts
    2,303

    Re: Min and Max for 2nd shift times

    Hi Mike

    Hoping that i get your point,i believe that is midnight problem and excel does not "knows" what date is it. i suggest this:

    Greate one more helper(hide, if you like)and put the dates there.

    Then use MAX for dates.

    Then use this for getting the max hOUR...

    =MAX(( A2:A170= A1)*B2:B170)

    Array formula. CSE,Not just enter.

    Hope to helps you.
    Attached Files Attached Files
    Regards

    Fotis.

    I am proud that i am Greek.

    Just to know every one.We Greeks, we are nοt proud of our politicians. Υou?

    Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Please,mark your thread [SOLVED] if you received your answer.


    My Avadar picture, is from Athens Acropolis.
    http://www.theacropolismuseum.gr

    http://www.visitgreece.gr/

  4. #4
    Valued Forum Contributor realniceguy5000's Avatar
    Join Date
    03-20-2008
    Location
    PA
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    926

    Re: Min and Max for 2nd shift times

    Thanks Guys, I used Pauls formula as it takes care of both issues.

    Thank You, Mike

+ 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.2.0