+ Reply to Thread
Results 1 to 5 of 5

Lookup, Index, Match ... Not sure which combo will do it?

  1. #1
    Registered User
    Join Date
    06-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    2

    Unhappy Lookup, Index, Match ... Not sure which combo will do it?

    I cannot figure this one out. I have a column of text which corresponds to a column of numbers. Some of the numbers are the same. I need a formula which will list all of the text corresponding to the number I tell it to search for.

    Example:

    -------A-------B
    1----Bob-----3
    2----Sue-----8
    3----Mike----4
    4----Jim------3
    5----Tom-----9
    6----Pam----2
    7-----Pat-----3

    I need a formula which would provide me a result of "Bob, Jim, Pat" when I search for "3". Or even a combination of formulas which would give me
    Bob
    Jim
    Pat
    ... and I could use the concatenate formula to put them into one field.

    Please help!!!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Lookup, Index, Match ... Not sure which combo will do it?

    String Concatenation is not a builtin Excel function, but it is easily added. This is VBA, though. (User Defined Functions, actually).

    Based on your needs, I'd suggest the CONCATIF() User Defined Function would do the trick. Would you be OK adding a new function to your workbook? This would require you to "enable macros" each time you open the workbook. If that's OK, then I can walk you through it.


    =======
    ConcatIf
    http://www.excelforum.com/excel-prog...in-cell.html#2 'explanation
    http://www.excelforum.com/attachment...if-example.xls 'sample
    http://www.excelforum.com/attachment...tif-sample.xls 'sample


    Your usage would be like this in a cell:
    =ConCatIf(B1:B10, 3, A1:A10,", ",TRUE)
    Last edited by JBeaucaire; 06-08-2010 at 03:07 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-08-2010
    Location
    Texas
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    2

    Re: Lookup, Index, Match ... Not sure which combo will do it?

    I'll likely be one of many (of varying experience levels) utilizing this worksheet so I'd like to keep the front end as clean and easy as possible. I'm a little concerned about using macros considering many would likely say "No" or close out of the window when the macro warning came up upon program launch ...

    Is this really my only option? If so, I'll probably need to come up with some sort of work-around to get the result I need...

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Lookup, Index, Match ... Not sure which combo will do it?

    Here's another option. If you enter the value you want to look up (i.e. 3) in cell E2, then in F2 and dragged to the right enter as an array (CNTRL SHFT ENTER)

    =IF(COLUMNS($B2:B2)>COUNTIF($B$1:$B$7,"="&$E2),"",INDEX($A$1:$A$7,SMALL(($B$1:$B$7=$E2)*ROW($A$1:$A$7),COLUMNS($B$2:B$2)+COUNTIF($B$1:$B$7,"<>"&$E2))))

    If it's entered correctly, you'll see brackets {} around it.

    See attachment. Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Lookup, Index, Match ... Not sure which combo will do it?

    Welcome to the forum, nikko.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly. A list of guesses is not a problem description.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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