+ Reply to Thread
Results 1 to 8 of 8

Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

  1. #1
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    Looking for formula to do a partial search and extract values in a Table (column A2:C142) into column K2:L24 if the words in K2:K24 are partially existing in C2:142.

    Example 1:
    J2 =1ST SOURCE CORP
    Formula should look into C2:142. for partial match. If there is, it should extract the values in A12 = 34782 and C12= SRCE. The partial words here are 1ST SOURCE CORP. The formula should be flexible to see Corp as partial word for corporation. See sample file.
    Attached Files Attached Files

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    I think your general strategy is going to be with helper columns that look something like:
    1) Create a helper column with a reduced name that strips out "Corp" "Corporation" "Inc" "," etc to come up with only the unique parts of the string. Probably with nested SUBSTITUTE although you could probably do something clever with an array?
    Well here's a guide for a UDF for exactly that, thinking about it getting text functions to play nice with arrays can be tough so this UDF might be your best bet.

    2) Then run something to get a position for where that shows up
    =SUMPRODUCT(ROW(range), --ISNUMBER(SEARCH(reduced_name, range))) looks like it would work.

    3) You can feed that position into a straight INDEX(A1:A1000, position) to get the CIK and do the same thing on column B to get the ticker. You could wrap (2) into those, but I'd probably leave it in a helper column just so you're only doing the calc once.

    Anyway that should about do it for you.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

  3. #3
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    One thing that might help you is Microsoft's fuzzy lookup add-in. See
    http://www.microsoft.com/en-us/downl....aspx?id=15011
    I have not used it myself but others on this forum have had success.


    Alternatively, here's a horrendous formula (although there is a great deal of repetition) that gets correctly 21 out of your 23 test cases.
    It takes a somewhat different approach to Ben's strategy.

    In J2 entered as an array formula with CTRL-SHIFT-ENTER:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    In K2 there is a virtually identical formula - the only difference being that it indexes into col-B instead of col-C.

    The formula gets rid of "," (comma) characters which caused a good number of problems. It then (wildcard) compares the first word of the names and next it (wildcard) compares the first 5 letters of the text beyond the first word. The formula chooses the first instance where both tests match (if any) and failing that then the first instance where one of the tests matches. If there are no matches then the formula generates a meaningless match (as opposed to an error message).

    Attached is an update to your workbook with the above changes. I have used CF in cols J:K to highlight the good matches (green) and the bad matches (pink).


    Hope this helps
    Attached Files Attached Files
    Geoff

    Did I help significantly? If you wish, click on * Add Reputation to say thanks.
    If your problem has been resolved please select ?Solved? from the Thread Tools menu

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,367

    Re: Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    Put on J2 and copied down:

    =IFERROR(LOOKUP(1000;SEARCH(SUBSTITUTE($C$2:$C$142;" ";"*");$E2);C$2:C$142);LOOKUP(1000;SEARCH(LEFT($C$2:$C$142;FIND(" ";$C$2:$C$142&" ")-1);$E2);C$2:C$142))
    Attached Files Attached Files

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

    Re: Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    Please try at K2:L2

    =INDEX(A$2:A$142,MATCH(LEFT(SUBSTITUTE($J2,",",),MATCH(0,INDEX(-MATCH(LEFT(SUBSTITUTE($J2,",",),ROW($C$1:INDEX($C:$C,LEN($J2))))&"*",$C$2:$C$142,),)))&"*",$C$2:$C$142,))
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    Excellent solution

  7. #7
    Forum Contributor
    Join Date
    02-06-2013
    Location
    Maryland
    MS-Off Ver
    Excel 2010
    Posts
    1,000

    Re: Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    Outstanding solution

  8. #8
    Forum Expert
    Join Date
    10-15-2018
    Location
    MA, USA
    MS-Off Ver
    2010, 2019
    Posts
    1,616

    Re: Partial Search to Extract values in a Table (column A2:C142) into column K2:L24

    Thanks for the feedback and rep!

+ 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] Formula to look into table A2:B23 and extract values into column F2:F28
    By bjnockle in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-22-2020, 08:23 AM
  2. partial text extract data in another column
    By beepetark in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-21-2019, 06:33 AM
  3. Replies: 4
    Last Post: 04-02-2019, 12:22 PM
  4. Search table for unique values, then extract from another column to match
    By PingTing in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-08-2018, 03:31 AM
  5. Extract unique values in a column from a table
    By gandreso in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2017, 11:21 AM
  6. [SOLVED] Search for multiple string values in the first row of a table and format column values.
    By Excel_junky in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-12-2013, 12:48 PM
  7. Replies: 1
    Last Post: 04-23-2012, 10:27 AM

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