+ Reply to Thread
Results 1 to 6 of 6

Lookup based on certain condition

  1. #1
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,225

    Lookup based on certain condition

    Hi all

    Wondering if it's possible for vlookup or index/match feature to include logic so it selects an answer based on "last active cell".

    For example, I have a list of employees and the "# of calls" they make. One individual is listed 3 times b/c they changed groups. The data shows the # of calls by months from July 2015-May 2018. When I do a vlookup or index/match, it returns the first value it finds....value I want to find is what "group" they work for, which is listed in column "B" in the productivity tab

    Is there any way to add logic in there where it scams through columns "H:AS" in the "productivity" tab and sees, for i.e. "Doe, John", which row of the 3 groups, has the most active data. For example, "Doe, John, is listed in productivity tab, in row 11:13. Row 13 shows the most active data, as row 11 and row 13 show 0 for month of may.

    I want my vlookup or index/match in the Lookup to show "intellectual property & tech" as the answer ; my current formula shows "employement labor".

    can someone pls help?! I have attached a sample sheet.
    Attached Files Attached Files
    Last edited by jw01; 05-30-2018 at 02:00 PM.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: Lookup based on certain condition

    Add a column with a unique number, in your case 1, 2, 3, 4.

    Use that number to perform the INDEX.
    This will cater for any future events where an employee move from PGG to another PGG and back to their original PGG.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

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

    Re: Lookup based on certain condition

    To clarify, should it be the most recent activity, or the most activity, as this line of your post implies?

    Is there any way to add logic in there where it scams through columns "H:AS" in the "productivity" tab and sees, for i.e. "Doe, John", which row of the 3 groups, has the most active data. For example, "Doe, John, is listed in productivity tab, in row 11:13. Row 13 shows the most active data, as row 11 and row 13 show 0 for month of may.
    edit:-

    Assuming most recent,

    Enter into Productivity B11 and fill down

    =IFERROR(MATCH(1E+100,H11:AS11),)

    Then use this array lookup formula

    =INDEX(Productivity!$B$11:$B$14,MATCH(TRUE,IF(Productivity!$E$11:$E$14=D13,Productivity!$BA$11:$BA$14=MAX(IF(Productivity!$E$11:$E$14=D13,Productivity!$BA$11:$BA$14))),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.

    Does that help?
    Last edited by jason.b75; 05-30-2018 at 11:53 AM.

  4. #4
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,225

    Re: Lookup based on certain condition

    Hi Jason.b75

    The formula you mention to enter in "productivity" cell B11 down - I CANT do that as that's the input from the system.

    I placed this formula
    =IFERROR(MATCH(1E+100,H11:AS11),)

    I assume the above formula should go in column "AZ" in productivity and the array formula then becomes:
    {=INDEX(Productivity!$B$11:$B$14,MATCH(TRUE,IF(Productivity!$E$11:$E$14=D12,Productivity!$AZ$11:$AZ$14=MAX(IF(Productivity!$E$11:$E$14=D12,Productivity!$AZ$11:$AZ$14))),0))}

    is that correct? thxs
    Last edited by jw01; 05-30-2018 at 12:03 PM.

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

    Re: Lookup based on certain condition

    Sorry, that was a typo, I should have said BA11, not B11.

    Using the formula in AZ 11 will work exactly the same, and your edit to the formula is correct.

  6. #6
    Forum Contributor
    Join Date
    11-26-2010
    Location
    usa
    MS-Off Ver
    Office 365
    Posts
    1,225

    Re: Lookup based on certain condition

    that worked amazing Jason.b75 thx you soo soo much!!!

+ 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. Replies: 5
    Last Post: 12-14-2014, 07:02 AM
  2. [SOLVED] VBA to Lookup value based on two condition.
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2014, 12:30 PM
  3. Populate Output sheet based on input data and lookup condition
    By Cool\m/ in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-10-2013, 04:45 AM
  4. Lookup formula based on a condition and date timeframe
    By rmitri in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-14-2013, 01:56 PM
  5. [SOLVED] If Lookup found, search cell value based on condition in matrix
    By tequilasunsette in forum Excel General
    Replies: 4
    Last Post: 06-14-2012, 12:03 PM
  6. Replies: 5
    Last Post: 05-16-2012, 01:47 PM
  7. [SOLVED] Sumproduct - Condition based on lookup of a Lookup
    By Hari in forum Excel General
    Replies: 13
    Last Post: 05-31-2006, 04:30 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