+ Reply to Thread
Results 1 to 3 of 3

Problem looking up shift from encoded cell with date/time?

  1. #1
    Registered User
    Join Date
    09-20-2010
    Location
    United States of America
    MS-Off Ver
    Excel 2013
    Posts
    4

    Problem looking up shift from encoded cell with date/time?

    I am trying to do a vlookup to find the work shift a cell entry occured during.

    The cell with the time I want to lookup also has a date. For example, the cell has "11/2/2010 12:57:24". Using the TIME function and functions for hour, minutes and seconds, I can extract from the cell only the time portion.

    But, then I run into a problem doing the vlookup using this time against a table that has for 24 hours what time periods are covered by 1st, 2nd and 3rd shifts.

    Please review the attachment and input the correct formula to lookup the shift in tab "DATA" cell "C2" or column C, based on if the time is equal or between the start and end time of each shift.


    Thank you,


    BennyB
    Attached Files Attached Files
    Last edited by NBVC; 11-03-2010 at 03:40 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Problem looking up shift from encoded cell with date/time?

    Try:

    =INDEX('LTB-SHIFT'!$C$2:$C$5,MATCH(1,INDEX(('LTB-SHIFT'!$A$2:$A$5<=MOD(B2,1))*('LTB-SHIFT'!$B$2:$B$5>=MOD(B2,1)),0),0))

    copied down.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-20-2010
    Location
    United States of America
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: Problem looking up shift from encoded cell with date/time?

    Thank you. Seems to work well.

+ 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