+ Reply to Thread
Results 1 to 5 of 5

How to return multiple values that match a single search criteria?

  1. #1
    Registered User
    Join Date
    11-16-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    33

    How to return multiple values that match a single search criteria?

    I'm fairly new to Excel, and I've been struggling with this problem for several hours now.

    Attached is a sample workbook, but essentially what I'm looking to do is automate the process of searching through a data set where the value of interest (in this case, names) often has multiple entries, with different values attached to each instance.

    I would like to be able to get a list of all values in a given column that match a specific name in another column.

    Currently I'm using a basic INDEX/MATCH search just to see whether the data exists at all, but that's only half of what I have to do here, and I'm totally stumped on how to get a comprehensive list of all matches.

    For reference, if you look at the sample, what I need is a list of all values in the "CPT" column that match the name searched for in the first column.

    The actual data set size is at most 3-400 entries, if that makes a difference in how to approach this.

    CPT Sample Book.xlsx

    Thanks.

  2. #2
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: How to return multiple values that match a single search criteria?

    Would something like this work? (See attached modified workbook)

    - Moo
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    11-16-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: How to return multiple values that match a single search criteria?

    Ah, nice!

    It will do, at the very least.

    Ideally, the solution would be a bit more modular. There are multiple workbooks that it would be great to move this data into, if feasible.

    For example, being able to have another workbook with a "Name" and "CPT" column referencing this, with only one row per name, and CPT populated in a "99284, 98010, ..." format in a single cell for each name would be the best case scenario here.

    Thanks though, this is definitely useful regardless of whether the above is doable

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: How to return multiple values that match a single search criteria?

    Your modified request is certainly doable, however, I'm thinking a VBA solution would be more appropriate/necessary. Search the forum, I know this has come up a few times recently.

    - Moo

  5. #5
    Registered User
    Join Date
    11-16-2012
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: How to return multiple values that match a single search criteria?

    Ok, thanks, will look into that.

    Edit:

    The VBA stuff I've found is a bit more complicated than I'm comfortable using for a work project right now - I've only just started to get my feet wet with VBA and I don't like just copy/pasting something I don't understand into a workbook other people will be using.

    Will be using your solution for the time being. Thanks again!

    Just wondering, how come I can't just use =CONCATENATE with the arguments being each of the IFERROR statements you used? When I try that, it returns a single value, and then just a string of ","s and spaces, regardless of whether the actual search field is returning more than one value.

    Not especially literate when it comes to long, nested formulas - is this a limitation of CONCATENATE, or am I just screwing up the syntax somewhere?
    Last edited by JSallen; 11-28-2012 at 12:07 PM.

+ 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