+ Reply to Thread
Results 1 to 9 of 9

Lookup based on multiple criteria and excluding blanks

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Lookup based on multiple criteria and excluding blanks

    I wonder if anyone can fix this formula for me:

    I want to list (in the right hand column F of the below table) all entries from that meet two conditions: 1) a "set" name given in column B and determined in column E and 2) affirmative answer to whether the value "a" is given in column D. I want the list to be populated from the values in column C (NAME) and I do not want the list to contain blanks.

    I have got quite far by using two formulas:

    First of all, Cell F1 counts rows that contain an "a" in column D: =COUNTIF($D$2:$D$54,"a")

    Secondly, the list (array) formula itself: {=IF(ROWS($A$2:$A2)>$F$1,"",INDEX($C$2:$C$54,SMALL(IF($B$2:$B$54=$E$1,IF($D$2:$D$18="a",ROW($D$2:$D$54)-ROW($D$2))+1,"1"),ROWS($A$2:$A2))))}

    As you can see from the table below, the formula above is listing one entry multiple times and return #NUM! for blanks. Any ideas where I'm going wrong? Help greatly appreciated.

    Blank SET NAME a/e SetA 10
    SetA Dave a Dave
    SetA John Dave
    SetA Anthony a Dave
    SetA Terry Anthony
    SetA Jude a Jude
    SetB Rudy a #NUM!
    SetB Carl #NUM!
    SetB Gemma a #NUM!
    SetB Christy a #NUM!
    SetB Paul #NUM!
    SetB India a
    SetC Reg a
    SetC Bobby
    SetC Felicity a
    SetC Trey
    SetC Connor a
    SetC Dan

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Lookup based on multiple criteria and excluding blanks

    show us an excel file, without confidentional information.

    please also add the desired (expected) result.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    01-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Lookup based on multiple criteria and excluding blanks

    File attached, thanks.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Lookup based on multiple criteria and excluding blanks

    Why not just filter, to get the desired result?

    See the attached file.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Lookup based on multiple criteria and excluding blanks

    Hi,

    That's not really what I'm after. Sorry I haven't explained very well.

    The Table will appear on a kind of monthly report and I will be doing a data drop on another worksheet which will change which rows have an "a" assigned to them in the third column. I want a table that tells me (after a data drop) which"names" belongsin set "A" and have an "a" in the third column.

    Any ideas? thanks for your help so far.

  6. #6
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Lookup based on multiple criteria and excluding blanks

    Try this:

    F2: =IFERROR(INDEX(C:C,SMALL(IF(B$2:B$18=E$1,IF(D$2:D$18="a",ROW(B$2:$B$18))),ROWS(F$2:F2))),"")

    Array Formula: Press Ctrl+Shift+Enter, not just Enter
    Copy down as far as needed

  7. #7
    Registered User
    Join Date
    01-22-2013
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Lookup based on multiple criteria and excluding blanks

    Fits like a glove, thanks Teethleee mama

  8. #8
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Lookup based on multiple criteria and excluding blanks

    You're Welcome!

  9. #9
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,366

    Re: Lookup based on multiple criteria and excluding blanks

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as "SOLVED".
    For the meantime I'll do it for you.

    How?
    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

    Note:
    You can also thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given.
    By doing so you can add to the reputation(s) of those who helped and shared their time in helping you.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

+ 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