+ Reply to Thread
Results 1 to 7 of 7

Formula that can lookup in a table and return shift time for the specific day and name

  1. #1
    Forum Contributor
    Join Date
    04-28-2013
    Location
    Miami, United States
    MS-Off Ver
    Excel 365 (Newest version)
    Posts
    254

    Formula that can lookup in a table and return shift time for the specific day and name

    Anyone knows a formula that can pull shift times located in a range based on day of the week. I have a formula that pulls the times for the specific day but the problem is, when that day change. I have to change the formula again to pull for that specific day. Is there anyway the formula can know when the day changes then the shift changes as well?

    I've attached a sample file for reference....

    Any help will be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula that can lookup in a table and return shift time for the specific day and name

    Try this one in H4 and fill down

    =IFERROR(1/(1/SUMIFS('Agent Schedules'!B:B,'Agent Schedules'!A:A,'Login Times'!B4,INDEX('Agent Schedules'!D:J,0,WEEKDAY(A4)),'Login Times'!G4)),"-")

    And this one in I4

    =IFERROR(1/(1/SUMIFS('Agent Schedules'!C:C,'Agent Schedules'!A:A,'Login Times'!B4,INDEX('Agent Schedules'!D:J,0,WEEKDAY(A4)),'Login Times'!G4)),"-")
    Last edited by jason.b75; 06-28-2018 at 11:52 AM. Reason: a big improvement just hit me like a freight train.

  3. #3
    Forum Contributor
    Join Date
    04-28-2013
    Location
    Miami, United States
    MS-Off Ver
    Excel 365 (Newest version)
    Posts
    254

    Re: Formula that can lookup in a table and return shift time for the specific day and name

    It worked!!!!!!!!! thanks a million!!!!!!

  4. #4
    Forum Contributor
    Join Date
    04-28-2013
    Location
    Miami, United States
    MS-Off Ver
    Excel 365 (Newest version)
    Posts
    254

    Re: Formula that can lookup in a table and return shift time for the specific day and name

    Is there anyway we can tweak this same formula to pull the Name "VAC" for the name and date? Its a similar process to how the formula works above but instead I want it to pull the word "VAC" for the date and name. The data I wish to pull is in the LOA tab.

    I've attached a sample file

    Is it possible?
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula that can lookup in a table and return shift time for the specific day and name

    Is this to replace the formula in I4?

    The formula in there already is the best option, however you do have a couple of minor errors with it (corrected below).

    =INDEX('LOA PLAN'!$M$1:$AP$71,MATCH('Login Times'!H4,'LOA PLAN'!$A$1:$A$71,0),MATCH($H$1,'LOA PLAN'!$M$1:$AP$1,0))

    Also you will need to correct the dates in the LOA PLAN M1:AP1, which are all for 2017, where the formula is looking for 2018.

  6. #6
    Forum Contributor
    Join Date
    04-28-2013
    Location
    Miami, United States
    MS-Off Ver
    Excel 365 (Newest version)
    Posts
    254

    Re: Formula that can lookup in a table and return shift time for the specific day and name

    Yep, its to replace the formula in I4... It works great. It works nicely...How do we tweak it to not ignore duplicates...For example I have 1 person listed twice on different dates. the formula does not pull once the name is located in the LOA tab twice.

    Any ideas how we can fix it?

  7. #7
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Formula that can lookup in a table and return shift time for the specific day and name

    It's a bit clunky but best I can think up to meet the requirements efficiently.

    =IF(COUNTIFS('LOA PLAN'!$A$3:$A$71,'Login Times'!H4,'LOA PLAN'!$C$3:$C$71,"<="&'Login Times'!$H$1,'LOA PLAN'!$D$3:$D$71,">="&'Login Times'!$H$1)=0,"-",INDEX(INDEX('LOA PLAN'!$M$3:$AP$71,0,MATCH($H$1,'LOA PLAN'!$M$1:$AP$1,0)),MATCH(2,1/IF('LOA PLAN'!$A$3:$A$71='Login Times'!H4,INDEX('LOA PLAN'!$M$3:$AP$71,0,MATCH($H$1,'LOA PLAN'!$M$1:$AP$1,0))<>""))))

    Array confirmed with Shift Ctrl Enter.

+ 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] Formula that can lookup multiple criteria and return a specific value...
    By cateyes_28 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-13-2015, 10:40 AM
  2. Replies: 2
    Last Post: 06-10-2015, 12:12 AM
  3. Replies: 2
    Last Post: 06-09-2015, 11:20 PM
  4. [SOLVED] Formula to Lookup a Table and return a Count value.
    By hammer2 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 12-03-2014, 12:59 AM
  5. need a lookup formula to return a specific result...
    By tsiguy96 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-15-2013, 08:40 AM
  6. Need Help on Time Sheet Formula (Day Shift OK/Night Shift=Problem)
    By jomapac in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-18-2013, 02:26 AM

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