+ Reply to Thread
Results 1 to 6 of 6

Searching a string of text using a formula

Hybrid View

  1. #1
    Registered User
    Join Date
    08-28-2012
    Location
    Sheffield, UK
    MS-Off Ver
    Excel 2010
    Posts
    30

    Searching a string of text using a formula

    Hi

    I am wanting to search a string of text (column A) for a name (column C), ideally a formula to search for two words (forename & surname) as they may be a middle initial on some records.

    Regards
    David
    Attached Files Attached Files

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Searching a string of text using a formula

    @MeDaveT,

    Using your example file, in cell D1 and copied down:
    =IFERROR(INDEX($A$1:$A$8,MATCH(1,INDEX(ISNUMBER(SEARCH(TRIM(LEFT(SUBSTITUTE(C1," ",REPT(" ",99)),99)),$A$1:$A$8))*ISNUMBER(SEARCH(TRIM(RIGHT(SUBSTITUTE(C1," ",REPT(" ",99)),99)),$A$1:$A$8)),),0)),"")

    Does that work for you?
    Hope that helps,
    ~tigeravatar

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

  3. #3
    Registered User
    Join Date
    08-28-2012
    Location
    Sheffield, UK
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Searching a string of text using a formula

    Kind of, however I would like the UK/LONDON/OFFICE/ etc not to show on the result

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Searching a string of text using a formula

    What result are you looking for then? Just the name that it found?

  5. #5
    Registered User
    Join Date
    08-28-2012
    Location
    Sheffield, UK
    MS-Off Ver
    Excel 2010
    Posts
    30

    Re: Searching a string of text using a formula

    Thinking about it the response I get should do the trick, thanks for your help

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Searching a string of text using a formula

    You're very welcome

+ 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