+ Reply to Thread
Results 1 to 3 of 3

Comparing Two Columns with partial matches

  1. #1
    Registered User
    Join Date
    05-16-2013
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2003
    Posts
    1

    Thumbs up Comparing Two Columns with partial matches

    Does anyone know a way in excel to compare two columns A and B and return a 1 or a 0 if their is a partial match?
    The data consists of addresses and street names I am trying to manually weed through these but thought the process might be automating in Excel with proper code.

    Example.

    Column A
    Corvey Ln

    Column B
    10531 Corvey Lane

    Can simple code derive a match from just comparing 3-4 characters in each column "Corv" and call it 1
    Keep in mind many of the addresses are not standardized and I am wanting the compare to just key in on 3-4 characters and call it 1 and if those don't match it = 0.

  2. #2
    Valued Forum Contributor Harribone's Avatar
    Join Date
    02-24-2013
    Location
    Midlands, UK
    MS-Off Ver
    Excel 2019/365
    Posts
    570

    Re: Comparing Two Columns with partial matches

    Maybe you can use the below in col c (C2):

    =IF(ISNUMBER(FIND(LEFT(A2,3),B2)),1,0)

    This will work if you want to compare the first 3 letters from A to see if exists anywhere in B.
    Say thanks, click *

  3. #3
    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
    53,048

    Re: Comparing Two Columns with partial matches

    This should work for you too...
    =IF(ISERROR(VLOOKUP("*"&LEFT(A1,3)&"*",B1:B3,1,FALSE)),0,1)
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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