+ Reply to Thread
Results 1 to 6 of 6

Search keyword in range of cells, then copy entire cell to another column

  1. #1
    Registered User
    Join Date
    08-11-2015
    Location
    London, Canada
    MS-Off Ver
    2010
    Posts
    5

    Search keyword in range of cells, then copy entire cell to another column

    Hi there,

    I am trying to come up with a function that will allow me to do the same thing as the find command but automatically in function form. To do this I would like to be able to search for a keyword within a range of cells, and then copy the cells containing that keyword to a separate column. For example, if one column was a list like "red fish, blue fish, red leader, clifford the big red dog, blue meanie" and the keyword I was searching for was "blue" then the new seperate column would read "Blue fish, blue meanie". Any help you can give would be greatly appreciated.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Search keyword in range of cells, then copy entire cell to another column

    Lets say your phrases are in A1:A5 and the word blue is in F1, try this formula copied down

    =IFERROR(INDEX($A$1:$A$5, AGGREGATE(15,6,INDEX(--(SEARCH($F$1,$A$1:$A$5)/SEARCH($F$1,$A$1:$A$5))*ROW($A$1:$A$5),),ROWS($A$1:$A1))),"")
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

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

  3. #3
    Registered User
    Join Date
    08-11-2015
    Location
    London, Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Search keyword in range of cells, then copy entire cell to another column

    Tried out your formula but I can't get it to work for my actual data set. Let's say my phrases are in AT1:AT91007 and the word blue is in F1. I wrote =IFERROR(INDEX($AT$1:$AT$91007, AGGREGATE(15,6,INDEX(--(SEARCH($F$1,$AT$1:$AT$91007)/SEARCH($F$1,$AT$1:$AT$91007))*ROW($AT$1:$AT$91007),),ROWS($AT$1:$AT$91007))),"") however the cells remain blank.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Search keyword in range of cells, then copy entire cell to another column

    The last part needs to change

    =IFERROR(INDEX($AT$1:$AT$91007, AGGREGATE(15,6,INDEX(--(SEARCH($F$1,$AT$1:$AT$91007)/SEARCH($F$1,$AT$1:$AT$91007))*ROW($AT$1:$AT$91007),),ROWS($AT$1:$AT1))),"") copied down

    Does that work for you?

  5. #5
    Registered User
    Join Date
    08-11-2015
    Location
    London, Canada
    MS-Off Ver
    2010
    Posts
    5

    Re: Search keyword in range of cells, then copy entire cell to another column

    Got it to work! Thank you so much for your help!
    Last edited by jreil563; 08-13-2015 at 12:42 PM.

  6. #6
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Search keyword in range of cells, then copy entire cell to another column

    Hello
    Suppose the data in "A4: A8" and keyword in B2
    Build in "C4:C8" the following matrix formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    put on B4, valid in the range, "B4: B8" the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    I send a file.


    Search.xlsx

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 01-13-2015, 12:35 PM
  2. [SOLVED] keyword search - a macros to change font color for specific key words (not entire cell)
    By kingwhopper in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-10-2014, 12:25 PM
  3. Replies: 7
    Last Post: 01-09-2013, 02:28 PM
  4. [SOLVED] search multiple worksheets in workbook for keyword then copy entire row to new worksheet
    By sck22 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-25-2012, 02:22 AM
  5. Replies: 3
    Last Post: 08-16-2012, 03:25 PM
  6. Replies: 2
    Last Post: 07-13-2012, 04:02 AM
  7. Replies: 1
    Last Post: 12-27-2010, 08:53 AM

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