+ Reply to Thread
Results 1 to 7 of 7

Vlookup with more than 1 criteria

  1. #1
    Forum Contributor Grimace's Avatar
    Join Date
    05-04-2009
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2013 and Office 365 Plus
    Posts
    380

    Vlookup with more than 1 criteria

    Good morning,

    In the attached exampe sheet i have a vlookup working through a roster to extract just the shift headings (LC1, LC2 etc) and the aligning start, finish and shift lengths from the adjacent columns.

    I now need to add in different role names. You will see in the end of column I there are now shifts called "Operational Advanced" with a number following.

    What I need to do is amend my formula so that either of these "Roles" will come up in the table under column B.

    There is potential for more different role names in the future, so ideally I would like to be able to expand this method as required.

    Thanks in advance

    Darren.
    Attached Files Attached Files
    Handy things to keep in mind:

    Click *, if my suggestion has helped you
    If your problem is solved, then please mark the thread as SOLVED

    Sharing is Caring .... spread the knowledge

  2. #2
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Vlookup with more than 1 criteria

    Hello,

    One way is that you use IFERROR and put in a second VLOOKUP
    Please Login or Register  to view this content.
    The advantage of this is that it is very light, making the calculating very fast.

    The downside is, however, it will be very hard to add another condition on it. In that case, you might want to look for an Array formula like this
    Please Login or Register  to view this content.
    Remember to hod Ctrl-Shift and hit Enter when you confirm. If you see the formula being wrapped inside a { } then you did it right.

    Here is your sample file illustrating both formula.
    Attached Files Attached Files
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  3. #3
    Forum Contributor Grimace's Avatar
    Join Date
    05-04-2009
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2013 and Office 365 Plus
    Posts
    380

    Re: Vlookup with more than 1 criteria

    Thanks Lemice,

    So I can check my understanding with the array method, if I need to add another different "Role" name, i would simply add it as follows:

    Please Login or Register  to view this content.
    Did I get that correct?

  4. #4
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Vlookup with more than 1 criteria

    Yes you are right, just add another ISNUMBER into it and it will work just fine.

  5. #5
    Forum Contributor Grimace's Avatar
    Join Date
    05-04-2009
    Location
    Gold Coast, Australia
    MS-Off Ver
    Excel 2013 and Office 365 Plus
    Posts
    380

    Re: Vlookup with more than 1 criteria

    Awesome thanks so much .... just what i needed.

  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Vlookup with more than 1 criteria

    Glad that I could help.

    Have a great day.

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Vlookup with more than 1 criteria

    an alternative method...

    add a helper column (I used P) and copy this down...
    =IF(OR(I3="",ISNUMBER(I3)),"",I3)

    Then in B3, copied down...
    =IFERROR(INDEX($P$3:$P$200,MATCH(0,INDEX(COUNTIF($B$2:B2,$P$3:$P$200),0,0),0)),"")
    and change the formula in C3 to this, coped down and across...

    =VLOOKUP($A3,$I$3:$O$250,COLUMN()-1,FALSE)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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