+ Reply to Thread
Results 1 to 4 of 4

searching for a word

  1. #1
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    searching for a word

    Hi there,
    In col "A" There are say 100 words. I need to find all the words that contain any character I enter in the Cell "B1" and list the results in col "D".. For example if I enter "br" in cell B1 I want " bread","hamburger","beer","butter","cucumber"..to be listed in col D . Or if I enter "ea"
    I need all the words that contain both "e" and "a" such as in " tea,ice-cream,steak,meat and metalic

    Thank you.
    Attached Files Attached Files
    Last edited by gencoglu27; 11-07-2011 at 12:52 AM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: searching for a word

    How many letters do you want to allow in B1?

    for 2 letters only you can use this "array formula" in C1

    =IFERROR(INDEX(A$1:A$100,SMALL(IF(ISNUMBER(SEARCH(REPLACE(B$1,2,0,"*"),A$1:A$100)),ROW(A$1:A$100)-ROW(A$1)+1),ROWS(C$1:C1))),"")

    confirmed with CTRL+SHIFT+ENTER and copied down
    Audere est facere

  3. #3
    Registered User
    Join Date
    07-10-2007
    Location
    Turkey-Bartın/
    MS-Off Ver
    Ms Office-2007
    Posts
    44

    Re: searching for a word

    How many letters do you want to allow in B1?]
    I think I should allow 3 letters in B1. Then things will be much easier..Could you please modify the code so that I can use 3 letters in B1.

    Thanks.

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: searching for a word

    Try this version for 1,2 or 3 letters in B1

    =IFERROR(INDEX(A$1:A$100,SMALL(IF(ISNUMBER(SEARCH(CHOOSE(LEN(B$1),B$1,REPLACE(B$1,2,0,"*"), REPLACE(REPLACE(B$1,2,0,"*"),4,0,"*")),A$1:A$100)),ROW(A$1:A$100)-ROW(A$1)+1),ROWS(C$1:C1))),"")

    confirmed with CTRL+SHIFT+ENTER and copied down

+ 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