+ Reply to Thread
Results 1 to 13 of 13

Searching for multiple words in a cell

Hybrid View

  1. #1
    Registered User
    Join Date
    05-02-2011
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Searching for multiple words in a cell

    Here it is...

    I've never used macros before so please excuse my complete igorance of the subject! I'm wondering if it's possible to have the program identify exact matches of the keyword (such as capitalization)? Also, I noticed when I repeat this process with an extremely large file, say 3000 rows of text, the macro debugger pops out - is there a size limitation to the operation of this macro?

    Thank you so so much!
    Attached Files Attached Files

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

    Re: Searching for multiple words in a cell

    Try:

    =SUBSTITUTE(SUBSTITUTE(TRIM(ACONCAT(IF(ISNUMBER(FIND($C$2:$C$17,B3)),SUBSTITUTE($C$2:$C$17," ","^^"),"")," "))," ",", "),"^^"," ")
    confirmed with CTRL+SHIFT+ENTER not just ENTER.

    This is case sensitive so if the string in column B has "congress" it will not pick up as a match to "Congress" in column C.

    I fixed it up so that you can still have comma delimiters, but it won't affect multi word entries like "Unites States".

    In some of your comments, you don't include "Congress" as being an expected match, like in D2.... but "Congress" does exist in B2.

    You also say that D15 should be blank, but I find that some of the words in column C do, in fact exist in B15 (and same with B16/D16 in case you are off by 1 row in your references in the comments).

    Also, I did copy the formula down to past 3000 rows and got no errors.... you just have to wait for the recalculating to finish as this is an array formula and can be slow when copied down thousands of rows.
    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.

+ 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