+ Reply to Thread
Results 1 to 9 of 9

Search Text of Cell in a range and return the contents

  1. #1
    Registered User
    Join Date
    11-09-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Search Text of Cell in a range and return the contents

    Hi,

    My query is similar to this, but there are 2 differences:

    1. The keywords in column A and the text strings in column B contain letters and numbers.
    2. As returned results I'd like to get the matched cells full content from column B(not the keywords).

    Please see attached sample:

    Book1.xlsx

    I'm newbie to Excel. Any help is really appreciated. Thank you.

    Regards
    Robert
    Last edited by jeffreybrown; 11-17-2012 at 11:00 PM.

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Search Text of Cell in a range and return the contents

    Hi Knowing,

    Welcome to the forum.

    Where you want the results ? would it be fine if I return the content in column C basis the entries in column A ?

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Search Text of Cell in a range and return the contents

    Hi Knowing,

    Use the below formula :-

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Enter this using Ctrl Shift Enter key combination.


    See attached:- Book1.xlsx

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  4. #4
    Registered User
    Join Date
    11-09-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Search Text of Cell in a range and return the contents

    Hi dilipandey,

    Thank you for quick response.

    Your formula works! It returns the desired results, but also produces other undesirable results(or I'm doing something wrong). This is not a big issue but if there is a way to get rid of it that would be good. Please see attached sample:

    Book1.1.xlsx

    Thank you very much for your help.

    Regards
    Robert

  5. #5
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Search Text of Cell in a range and return the contents

    In my post #2, I already mentioned about it as
    Where you want the results ? would it be fine if I return the content in column C basis the entries in column A ?
    you need the output from column B based on Column A.. but since you have placed data in column B which is directly after column A, hence I could not find place to put formula and placed that in column C BUT the formulas are looking in column A only.. and should be dragged down till the data exists in column A. I have observed that you have dragged the formula till the data exists in column B.. which should not be done.

    But if you still want to do like that, use below formula:-

    =IF(A2="","",INDEX($B$1:$B$14,MIN(IF(ISNUMBER(SEARCH($A2,$B$2:$B$14)),ROW($B$2:$B$14),""))))
    See attached:-Book1.1.xlsx


    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  6. #6
    Registered User
    Join Date
    11-09-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Search Text of Cell in a range and return the contents

    Hi dilipandey,

    I shouldn't drag the formula till the data exists in column B. It should be dragged down till the data exists in column A. That's it. So your 1st formula works perfectly!
    Thank you.
    Is there a way to get the formula to perform the search in multiple columns?

    Thank you very much for your help.

    Regards
    Robert

  7. #7
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Search Text of Cell in a range and return the contents

    yes.. for multiple column search, you can play with the formula part MIN(IF(ISNUMBER(SEARCH($A2,$B$2:$B$14)),ROW($B$2:$B$14),""))

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

  8. #8
    Registered User
    Join Date
    11-09-2012
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Search Text of Cell in a range and return the contents

    Hi dilipandey,

    Many thanks for your help. Best wishes.

    Regards
    Robert

  9. #9
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Search Text of Cell in a range and return the contents

    You are welcome Knowing..

    cheers

    Regards,
    DILIPandey

    <click on below 'star' if this helps>

+ 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