+ Reply to Thread
Results 1 to 2 of 2

Compare similar text strings, line up two records and bring back a cell value

  1. #1
    Registered User
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2010
    Posts
    4

    Compare similar text strings, line up two records and bring back a cell value

    Hey There,
    I have two spreadsheets and I want to line up the records with each other. The only way I can do this by comparing two strings of text and looking for regions of identity and in case it meets a threshold I need a value to be returned.

    In the attached two spreadsheets, what I need to do is

    For example From sheet one, (reference data A), I need to compare Inventory part Description, Column A, Name, with Company data, column C from sheet 2, company data. And then what needs to happen is, once I get a hit, I need to bring back the value from sheet 1, reference data, column B, Riskgroup.
    To give you an idea of the likely % match, problem at hand, for example,
    Sheet one reference data, A936 = “THP-1”
    Lines up with (“sheet 2, company data”), cell C25 = “THP-1; Acute Monocytic Leukemia; Human (Homo sapiens)

    To further complicate things, it is normally only the first few characters, less than 10 where the match is and the rest of the string confuses the situation with words like human that would be common to many records. For this reason, I could probably just move the first 10 or so characters to a new column. There is a formula for that I think.
    It’s never going to be perfect but if I can line these two sets of records up this way then it saves a hell of a lot of work. I think a visual basic formula might be a way to go but the whole thing is not really my area. I am no computer programmer / not even a decent excel user.

    Thanks so much.

    Please see attached

    Cheers

    Joe
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,567

    Re: Compare similar text strings, line up two records and bring back a cell value

    See if the following is headed in the right direction, we can then attempt to make some refinements if possible.
    Columns D and E respectively truncate the data at the first ";" and "," using: =IFERROR(LEFT(C2,SEARCH(";",C2)-1),"") and =IFERROR(LEFT(C2,SEARCH(",",C2)-1),"")
    Column F displays the resulting (shorter) string using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Column G displays strings that don't have either of the punctuations using: =IF(AND(D2="",E2=""),C2,"")
    Column H displays the final list of strings using: =F2&G2
    Column I displays the match (if any) using: =MATCH(H2,'ref data a sheet 1'!A$2:A$1000,0)+1
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. vlookup - bring back blank cell when it brings back 0 and N/A
    By julee.stein in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2018, 11:12 AM
  2. Array Formula Lookup - Bring back Lowest Date + Bring Back Cell Location
    By Matt1998 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-04-2014, 12:08 PM
  3. Replies: 4
    Last Post: 09-04-2012, 03:23 PM
  4. Compare A to B and bring back NON-error
    By amyj22x3 in forum Excel General
    Replies: 3
    Last Post: 08-09-2011, 08:48 PM
  5. Replies: 3
    Last Post: 05-28-2011, 01:43 PM
  6. Replies: 1
    Last Post: 10-18-2010, 06:32 PM
  7. [SOLVED] Find a non-blank cell and bring back text a in same row
    By Rod in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-24-2005, 06:06 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