+ Reply to Thread
Results 1 to 7 of 7

How to search sub-strings in a lookup table

  1. #1
    Registered User
    Join Date
    02-27-2019
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    4

    How to search sub-strings in a lookup table

    Hello everyone,

    I would like to ask for help from the Excel experts out there. I would like to find a way to lookup a sub-string in a lookup table and pick the highest score from this table if two sub-strings in a row are found in the table.

    For example, let imagine we have Sheet1 with a set of substrings separted by a space in Column A as depicted below:

    Sheet1
    Col A
    Str1 Str2 Str3
    Str4 Str5
    Str6 Str7 Str8

    I would like to enter your formula in Column B of Sheet1 so it would display the correct score. Please note that the number of sub-strings in each row of Column A may vary.

    Now, let's suppose Sheet2 has the following values:
    Sheet2
    Col A ColB
    Str2 10
    Str7 10
    Str8 20

    Therefore, we would expect the following answers:

    Sheet1
    Col A
    Str1 Str2 Str3 10
    Str4 Str5
    Str6 Str7 Str8 20

    Any help on this will be much appreciated.

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: How to search sub-strings in a lookup table

    Think you might have to use TEXTJOIN if you have it or VBA.
    Doubt another formula can do this text building.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    02-27-2019
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    4

    Re: How to search sub-strings in a lookup table

    Apologies. The scores 10 and 20 would be displayed under Column B in the expected answers section above. Therefore, there is not need to join the scores as text to the sub-strings in Column A.

    Thank you Special-K for looking into this. Much appreciated.

  4. #4
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,765

    Re: How to search sub-strings in a lookup table

    Quote Originally Posted by Fireball69 View Post
    Hello everyone,
    Sheet2
    Col A ColB
    Str2 10
    Str7 10
    Str8 20


    Therefore, we would expect the following answers:

    Sheet1
    Col A
    Str1 Str2 Str3 10
    Str4 Str5
    Str6 Str7 Str8 20

    Why 20 in bolded line not 10? Value assign to Str8 beat value assign to Str7?

    If StrX are only examples and in real string are total different, check attached file, is that what are You looking for.

    1.JPG2.JPG
    Attached Files Attached Files
    Last edited by KOKOSEK; 03-01-2019 at 01:22 PM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  5. #5
    Registered User
    Join Date
    02-27-2019
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    4

    Re: How to search sub-strings in a lookup table

    Thanks a million KOKOSEK. This is pretty close to what I am looking for but unfortunately the formula does not seem to take the highest score when two sub-strings are found in the lookup table. Looking at the file you uploaded, the formula in the last row ideally should give 20, not 10. I realize this might be difficult to achieve but if you have any ideas, it would be much appreciated.

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: How to search sub-strings in a lookup table

    Please try at Sheet1 B1

    =IFERROR(AGGREGATE(14,6,Sheet2!$B$1:$B$3/ISNUMBER(SEARCH(Sheet2!$A$1:$A$3,Sheet1!A1)),1),"")

  7. #7
    Registered User
    Join Date
    02-27-2019
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    4

    Re: How to search sub-strings in a lookup table

    Thank you Bo_Ry for providing the alternative approach.

    Also thanks to everyone for the efforts. Much appreciated.

+ 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: 10
    Last Post: 09-16-2015, 11:25 PM
  2. Replace string with strings from lookup table
    By ASWArchangel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-06-2014, 01:56 PM
  3. Vlookup; lookup cell contains multiple strings to search for
    By jamie1985 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-17-2014, 03:43 AM
  4. [SOLVED] search for parts of strings in another list of strings
    By marioroter in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 12-17-2013, 12:28 PM
  5. excel formula to search Multiple strings in several columns and return strings
    By krratna123 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-13-2013, 11:20 AM
  6. Replies: 1
    Last Post: 08-13-2013, 08:32 AM
  7. Replies: 4
    Last Post: 01-04-2013, 12:22 PM

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