+ Reply to Thread
Results 1 to 11 of 11

Search cell B for a range of specific text and place corresponding text in cell A

  1. #1
    Registered User
    Join Date
    10-22-2020
    Location
    Melbourne
    MS-Off Ver
    Home 365
    Posts
    8

    Search cell B for a range of specific text and place corresponding text in cell A

    Hi all, I have a formula that is more or less working but is a bit clunky and I assume there is a more efficient method.

    I have data in column B. I want to search each cell in column B for a range of specific text (listed in column C) and if found, place the text from the corresponding row in column D into column A.

    I have set this up with the followings IFS function eg for cell A1:

    =IFS(ISNUMBER(SEARCH($C$1,B1)),$D$1,ISNUMBER(SEARCH($C$2,B1)),$D$2,ISNUMBER(SEARCH($C$3,B1)),$D$3... etc etc

    So it's searches B1 for the text listed in C1. If found, it places the text in listed D1 into A1. It then searches for the text listed in C2. If found, it places the text in listed D2 into A1, and so.

    To search for all the text listed in column C, I have to duplicate the formula many times. Is there a way to do this more efficiently, where it searches through the entire column C rather than having to search each cell individually? Something like

    =IFS(ISNUMBER(SEARCH(C1:C9,B1)),D1:D9)

    I've tried this but get a #SPILL! error. Any ideas?
    Last edited by jake_h03; 10-22-2020 at 02:33 AM. Reason: Title

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    Hi see yellow banner on how to add an example sheet with some data and manually added expected results
    Thanks

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    Not sure you 'd like to search for full or partial match, but I offer 2 cases of match in attachment.
    Attached Images Attached Images
    Attached Files Attached Files
    Quang PT

  4. #4
    Registered User
    Join Date
    10-22-2020
    Location
    Melbourne
    MS-Off Ver
    Home 365
    Posts
    8

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    Thanks Bebo, but I think I have already achieved this. What I would like to do is search for any match from any cell in column C within the text in cell B1, rather than having to search each cell column C with a separate equation.

    See attached for a file which shows what I have done so far, which is essentially working as desired but if the list of entries in column C gets, the formula will get very cumbersome.
    Attached Images Attached Images
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    This, maybe:

    =INDEX(D:D,AGGREGATE(15,6,ROW($C$1:$C$10)/(ISNUMBER(SEARCH($C$1:$C$10,B1))),1))

    copied down.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Registered User
    Join Date
    10-22-2020
    Location
    Melbourne
    MS-Off Ver
    Home 365
    Posts
    8

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    Quote Originally Posted by Glenn Kennedy View Post
    This, maybe:

    =INDEX(D:D,AGGREGATE(15,6,ROW($C$1:$C$10)/(ISNUMBER(SEARCH($C$1:$C$10,B1))),1))

    copied down.
    This is perfect. Thanks so much Glenn, appreciate your help!

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    You're welcome.

  8. #8
    Registered User
    Join Date
    10-22-2020
    Location
    Melbourne
    MS-Off Ver
    Home 365
    Posts
    8

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    One last question, when I copy the formula across to a larger project (with different columns in use), I am getting a #NUM! error for cells that don't find a match. Any ideas how to fix this?

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    =IFERROR(INDEX(D:D,AGGREGATE(15,6,ROW($C$1:$C$10)/(ISNUMBER(SEARCH($C$1:$C$10,B1))),1)),"")

    should fix that.

  10. #10
    Registered User
    Join Date
    10-22-2020
    Location
    Melbourne
    MS-Off Ver
    Home 365
    Posts
    8

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    Great, thanks again Glenn

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,036

    Re: Search cell B for a range of specific text and place corresponding text in cell A

    You're welcome.

    ________________________________________

    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. [SOLVED] Search many workbooks for specific text, then insert a text in adjacent cell
    By MDW12 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-26-2017, 02:08 PM
  2. Search for text and place in another cell
    By Poppin1337 in forum Excel General
    Replies: 3
    Last Post: 03-19-2017, 05:05 PM
  3. search text string in cell and if found place a text in other cel
    By wildy1600 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-30-2015, 12:41 PM
  4. [SOLVED] VBA to Find Specific Text, then Copy range to next open cell under specific text
    By Remotruker in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-24-2015, 10:59 AM
  5. [SOLVED] Place text in adjoining cell if cell contains specific text
    By xrayexceller in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-05-2013, 11:27 PM
  6. Replies: 2
    Last Post: 08-05-2013, 07:32 PM
  7. Replies: 19
    Last Post: 04-10-2013, 08:30 AM

Tags for this Thread

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