+ Reply to Thread
Results 1 to 4 of 4

search a cell for values in a range, return values found

  1. #1
    Registered User
    Join Date
    04-15-2011
    Location
    Lafayette, LA
    MS-Off Ver
    Excel 2007
    Posts
    4

    search a cell for values in a range, return values found

    I have a list of values in column A on sheet1. Something like this:

    A1=" AM100 "
    A2=" RM100 "
    A3=" URM100 "
    etc.

    I need to search inside of another cell that contains a comma delimited list in C1 on sheet2, for instance:

    C1=" AM100 , MEO1 , RM100 , TXT1 "

    I am trying to find a way to output all of the values that exist in column A and are found in cell C1 in a comma delimited string in another cell. For instance, output should be D1 on sheet2:

    D1=" AM100 , RM100 "

    I have been banging my head against this and cannot figure it out.
    Last edited by carpe.cervisiam; 04-15-2011 at 12:48 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: search a cell for values in a range, return values found

    Have a look at this thread with very similar requirement:

    http://www.excelforum.com/excel-work...arguments.html

    add the same UDF to your spreadsheet and then use similar formula:

    =SUBSTITUTE(TRIM(aconcat(IF(ISNUMBER(SEARCH(" "&$A$1:$A$3&" "," "&C1&" ")),$A$1:$A$3,"")," "))," ",", ")

    confirmed with CTRL+SHIFT+ENTER not just ENTER
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-15-2011
    Location
    Lafayette, LA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: search a cell for values in a range, return values found

    Thank you, Thank you, Thank you! Worked like a charm!

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: search a cell for values in a range, return values found

    Seems I late)) But I'll post code anyway))

    Please Login or Register  to view this content.
    Or this UDF
    Please Login or Register  to view this content.
    Then in D1 of second sheet use this formula
    =SrchValInRng(Sheet1!A1:A3,C1)

    HTH))
    Last edited by contaminated; 04-15-2011 at 01:12 PM.
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

+ 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