+ Reply to Thread
Results 1 to 5 of 5

Lookup based on lastest date

  1. #1
    Registered User
    Join Date
    11-22-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    12

    Lookup based on lastest date

    I am trying do up lookup formula to locate a value based on a latest date of a particular column and corresponding criteria.

    Please see example below.
    I wish to find the lastest value based on EffectiveDate with the corresponding EmpID.

    So the values under the SalaryAnnual (highlighted in red), it should be reflected as 55,000 for EmpID E10001, and 53,250 for EmpID E10002.

    I have been trying to use - if max array, but none seem to work!..

    EmpID....Name....EffectiveDate....SalaryAnnual...EmpID.....SalaryAnnual
    E10001....LSJ.......01/04/2009 ......50,000 ...........E10001....55,000
    E10002....CYS......01/04/2009 ......48,000 ...........E10002....53,250
    E10001....LSJ.......01/04/2010 ......53,000
    E10002....
    CYS......01/04/2010 ......51,000
    E10001....
    LSJ.......01/05/2010 ......55,000
    E10002
    ...CYS .....01/05/2010 ......53,250

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Lookup based on lastest date

    Please Login or Register  to view this content.
    The formula in G2 and copied down is

    =INDEX($D$2:$D$7, MATCH(F2 & MAX(IF($A$2:$A$7=F2,$C$2:$C$7)), $A$2:$A$7 & $C$2:$C$7, 0))

    It MUST be confirmed with Ctrl+Shift+Enter.

    You have some trailing blanks in col A that need to be fixed.
    Entia non sunt multiplicanda sine necessitate

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

    Re: Lookup based on lastest date

    If your dates are listed chronologically for each user as per your sample, then this too may work:

    =LOOKUP(2,1/($A$2:$A$7=E2),$D$2:$D$7)
    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.

  4. #4
    Registered User
    Join Date
    11-22-2009
    Location
    Singapore
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Lookup based on lastest date

    Thanks! =INDEX($D$2:$D$10, MATCH(F2 & MAX(IF($A$2:$A$10=F2,$C$2:$C$10)), $A$2:$A$10 & $C$2:$C$10, 0)) works well for me!

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Lookup based on lastest date

    I like NBVC's if the dates are indeed in ascending order.

+ 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