+ Reply to Thread
Results 1 to 9 of 9

Lookup: Lookup employee id and return value in cell x basued on most recent start date

  1. #1
    Registered User
    Join Date
    04-25-2018
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    34

    Lookup: Lookup employee id and return value in cell x basued on most recent start date

    I would like some assistance in creating a formula that looks up an employee id number and returns the value in column F based on the most recent date. There are potential duplicates in the employee id column which is why I would like to search for the most recent "transaction." I have attached a sample workbook. I can't quite wrap my head around index/match formulas and I believe some variation of that will be required to make this happen.

    Thank you in advance.
    Attached Files Attached Files
    Last edited by jekeith; 05-21-2018 at 11:39 AM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat

    Try

    in B4

    =MAX(IF($D$4:$D$1000=A4,$E$4:$E$1000))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    format column b as mm/dd/yyyy;;;@ to hide the 0 results

  3. #3
    Registered User
    Join Date
    04-25-2018
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    34

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat

    Thanks John, I actually want to return the value on the "Type of Leave" column not the date value. Also I need it to lookup based on the values in column A
    Last edited by jekeith; 05-21-2018 at 11:47 AM. Reason: clarification

  4. #4
    Forum Contributor
    Join Date
    09-18-2015
    Location
    Republic of Korea
    MS-Off Ver
    2010
    Posts
    314

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat


  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat

    Try

    =IFERROR(INDEX($F$4:$F$1000,MATCH(MAX(IF($D$4:$D$1000=A4,$E$4:$E$1000)),$E$4:$E$1000,0)),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

  6. #6
    Registered User
    Join Date
    04-25-2018
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    34

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat

    I am trying to return the leave type with the most recent date associated with a given ID. Maxifs won't get me quite where I need to go. @chief_abound.

  7. #7
    Registered User
    Join Date
    04-25-2018
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    34

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat

    Quote Originally Posted by JohnTopley View Post
    Try

    =IFERROR(INDEX($F$4:$F$1000,MATCH(MAX(IF($D$4:$D$1000=A4,$E$4:$E$1000)),$E$4:$E$1000,0)),"")

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    I will try this out. Thanks John!

  8. #8
    Registered User
    Join Date
    04-25-2018
    Location
    Nashville, TN
    MS-Off Ver
    2016
    Posts
    34

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat

    I tried the formula out and while it looks more like what I thought might required it only returns the error value. Maybe If i rephrase what I am asking for help with, that might getting us going in the right direction. Using the spreadsheet provided above. I want start by looking up the ID value in column A in table 1[column d] and return the value in column F for the most recent date IF there are duplicates.

    Please Login or Register  to view this content.
    This actually seems to have done the trick.

    Thanks everyone.
    Last edited by jekeith; 05-21-2018 at 12:57 PM.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Lookup: Lookup employee id and return value in cell x basued on most recent start dat

    See attached
    Attached Files Attached Files

+ 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. Lookup start - end date, Return information
    By LeeBillington in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-30-2018, 02:35 PM
  2. [SOLVED] Nest lookup Function to lookup name between date range and return value
    By bbeards in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-17-2018, 01:37 PM
  3. Replies: 4
    Last Post: 05-02-2017, 02:21 PM
  4. [SOLVED] Lookup Multiple Criteria using most recent date
    By tsadams23 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-26-2015, 09:51 AM
  5. [SOLVED] formula to lookup most recent date
    By a2424 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2014, 09:22 PM
  6. [SOLVED] Index an array, return most recent repair, first three letters lookup
    By Martin Chamberlin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-16-2014, 08:57 AM
  7. [SOLVED] Lookup first two letters and return the most recent data
    By Martin Chamberlin in forum Excel General
    Replies: 12
    Last Post: 05-12-2014, 02:38 AM

Tags for this Thread

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