+ Reply to Thread
Results 1 to 7 of 7

Search Text String for Match in a Column of Key Words

  1. #1
    Registered User
    Join Date
    06-23-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    4

    Search Text String for Match in a Column of Key Words

    Hello, long-time reader first time poster.

    My data:
    Table1 - Column with detailed transaction descriptions (Description)
    Table2 - Column with a list of key words (VendorKey) and column with vendor names (Vendor)

    My problem:
    Add a column to Table1 that returns a value from the Vendor column in Table2 by finding the VendorKey in Table2 within the the Description in Table1

    My in-process solution:
    Using Sumproduct, I'm able to get a value of 1 a value in the VendorKey column is found within the Description column and a zero if it's not. But I am unable to figure out how to find the row that the matching VendorKey is found in order to pull in the Vendor. Below is the formula I have so far. Any help is very much appreciated!

    =SUMPRODUCT(--(NOT(ISERR(SEARCH(Table2[[#All],[VendorKey]],[@Description])))))

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Search Text String for Match in a Column of Key Words

    Hi, welcome to the forum

    (sounds like homework, but you have made a good start)

    Have you looked at using INDEX/MATCH or VLOOKUP for this?

    upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    06-23-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Search Text String for Match in a Column of Key Words

    Thank you sir for your quick reply! Attached is the sample file.

    I tried to incorporate Index/Match/Row but I wasn't able to get it to work. I did write a query in Access that worked but I'd rather keep this in Excel if I can.

    Thanks again!
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Search Text String for Match in a Column of Key Words

    Sorry for the delay in responding

    So will the 1st word always be "the" followed by the 1-or-2 word phrase you are looking for?

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,175

    Re: Search Text String for Match in a Column of Key Words

    Try

    in B3

    =IFERROR(INDEX($E$3:$E$5,IF(SUMPRODUCT(--ISNUMBER(SEARCH($F$3:$F$5,$A3))*ROW($F$3:$F$5)),SUMPRODUCT(--ISNUMBER(SEARCH($F$3:$F$5,$A3))*ROW($F$3:$F$5))-2,"")),"")

    copy down

    OR

    =IFERROR(INDEX(Table2[Vendor],SUMPRODUCT(--ISNUMBER(SEARCH(Table2[VendorKey],[@Description]))*ROW(Table2[VendorKey]))-2),"")


    (Not a great fan of Tables!!)
    Last edited by JohnTopley; 04-29-2017 at 04:20 AM.

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Search Text String for Match in a Column of Key Words

    Or:

    =IFERROR(LOOKUP(2,1/SEARCH(Table2[VendorKey],[@Description]),Table2[Vendor]),"")

  7. #7
    Registered User
    Join Date
    06-23-2012
    Location
    Chicago
    MS-Off Ver
    Excel 2016
    Posts
    4

    Re: Search Text String for Match in a Column of Key Words

    JohnTopley & Phuocam - Both solutions work! Thank you both very much!!

    Having the ability to do this look-up will be a big productivity improvement to our expense coding process. I am very grateful for the assistance.

+ 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: 2
    Last Post: 05-27-2016, 12:30 AM
  2. Replies: 15
    Last Post: 10-12-2014, 08:53 AM
  3. match string in column with array of words
    By bkdimri in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-16-2013, 04:28 AM
  4. Search string of words in text
    By excelnik in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 05-31-2013, 05:10 PM
  5. Replies: 1
    Last Post: 04-04-2012, 07:15 PM
  6. Replies: 1
    Last Post: 07-26-2011, 06:48 AM
  7. [SOLVED] How do I do a multiple search using key words in a text string
    By patricia tipp in forum Excel General
    Replies: 1
    Last Post: 02-28-2006, 01:10 PM

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