+ Reply to Thread
Results 1 to 3 of 3

Search for an array of strings in a single cell and display adjacent cell value

  1. #1
    Registered User
    Join Date
    12-16-2009
    Location
    Toronto ON
    MS-Off Ver
    Excel 2003
    Posts
    2

    Search for an array of strings in a single cell and display adjacent cell value

    Hello I am new here and need help with the following.
    I have a column A with a range of text fields which contain last names somewhere in the text(some at beginning of string, some at end of string and some in middle of string). In cell B1, I need to search for a range of names(C1:C4) in A1. If a match is found, then the formula should return the the value of the adjacent cell in column D describing their position on the project.

    I can do it using VLookup if all the names are on the left.
    =VLOOKUP(LEFT(A1,4),C$1:D$4,2, FALSE)
    But it wont work if the text is scattered in the cell.

    Thanks,
    Attached Images Attached Images

  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 for an array of strings in a single cell and display adjacent cell value

    Try

    =LOOKUP(2,1/(ISNUMBER(SEARCH($C$2:$C$4,A2))),$D$2:$D$4)

    adjust ranges to suit.
    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
    12-16-2009
    Location
    Toronto ON
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Search for an array of strings in a single cell and display adjacent cell value

    Thanks NBVC, it works perfectly.

    Regards,
    Tony.

+ 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