+ Reply to Thread
Results 1 to 3 of 3

Using a discrete range of keywords, search a text string for match

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Using a discrete range of keywords, search a text string for match

    Hello, all. First time in a forum so if I make a few foopars please go easy on me.
    I have a spreadsheet which contains a column of car makers (Col A). In another column (Col C) I have a comment about a particular model in that makers range. I want to create a formula which searches the text comment for a keyword (the model) and return that keyword (model name). The keywords (models) in reality are listed in another spreadsheet in columns under the makers name. However I have uploaded a spreadsheet as an example with it all in one. The models are listed under makers names column headings in named ranges to make it easier to add models in the future.
    I managed to get it partly working using the SEARCH function but it struggled with the named ranges and I ended up with a huge nested formula which wasn't very elegant and needed a lot of manual editing for each cell. The solution will actually be run over a 2000 row spreadsheet so it needs to be draggable. I have also tried to use a nested Match but tied myself in knots. Any suggestions?
    Many Thanks
    Ian99
    Discrete range Keyword searrch text string problem.xls

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Using a discrete range of keywords, search a text string for match

    Put this formula in D2 and copy down:

    =LOOKUP(2, 1/(ISNUMBER(SEARCH(INDIRECT(A2), C2))), INDIRECT(A2))


    To see how it works, click on D2, then go to Formulas > Evaluate Formula and step through that formula one calc at a time.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Using a discrete range of keywords, search a text string for match

    Many thanks JBeaucaire, your formula has just saved me probably a days work. I've not got my head around how it works yet but I will.
    Thanks again
    Ian99

+ 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