+ Reply to Thread
Results 1 to 6 of 6

Function to return 2 columns based on 2 user selected criteria

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    boston, ma
    MS-Off Ver
    Excel 2010
    Posts
    25

    Function to return 2 columns based on 2 user selected criteria

    Hello,

    I currently have a workbook which contains a list of days/times and names of people who are available on those days. Is there a set of functions that can find which of these people meet user specified criteria (2 drop down lists) and retrieve their information?

    I have attached a copy of a sample workbook which contains the information I am trying to work with. Thank you in advance for any and all assistance!
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Function to return 2 columns based on 2 user selected criteria

    you can do it like this
    2 named ranges for validation dropdown and a helper column I put on the dropdown info sheet
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Function to return 2 columns based on 2 user selected criteria

    You don't need 2 drop downs. You can just use the column headers on the Data sheet as the selections for a single drop down list. And, this means you don't need the Drop Down sheet.

    Here's your file:

    TestnewExcelsheet(1).xlsx

    The formula in column B is an array formula.

    Array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Valued Forum Contributor AZ-XL's Avatar
    Join Date
    03-22-2013
    Location
    Azerbaijan, Baku
    MS-Off Ver
    Excel 2007
    Posts
    603

    Re: Function to return 2 columns based on 2 user selected criteria

    Hi
    =INDEX(Data!$A$2:$A$8,MATCH(SMALL(IF(INDEX(Data!$D$2:$R$8,0,MATCH(TRUE,SEARCH($C$3,Data!$D$1:$R$1)*VALUE(SUBSTITUTE(Data!$D$1:$R$1,switchboard!$C$3,""))=$D$3,0))="yes",ROW(Data!$A$2:$A$8)-1,""),ROW(A1)),IF(INDEX(Data!$D$2:$R$8,0,MATCH(TRUE,SEARCH($C$3,Data!$D$1:$R$1)*VALUE(SUBSTITUTE(Data!$D$1:$R$1,switchboard!$C$3,""))=$D$3,0))="yes",ROW(Data!$A$2:$A$8)-1,""),0)) Ctrl+shift+enter

    it doent use helper column but it shows NUM error if there are no more "yes" criteria. I couldnt use Iferror function Because it said there are too much nested function. Actually its first time happening to me.
    Appreciate the help? CLICK *

  5. #5
    Registered User
    Join Date
    07-16-2012
    Location
    boston, ma
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Function to return 2 columns based on 2 user selected criteria

    I cannot thank you all enough, I am working through each of the functions sent to see which makes it easiest for the user. You saved me a ton of time and a few headaches trying to piece functions together!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Function to return 2 columns based on 2 user selected criteria

    You're welcome. Thanks for the feedback!

+ 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