+ Reply to Thread
Results 1 to 9 of 9

Extract common text strings between two cells A1 B1

  1. #1
    Registered User
    Join Date
    11-21-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    6

    Extract common text strings between two cells A1 B1

    Hi all,

    This is my first post; i hope i can make you understand what i want to :P

    I have a worksheet containing addresses in column A and B to compare, I need to compare address of A1 to B1 cell particularly and have to check if the:
    Address is same of A1 and B1 cell then Outcome- True
    Address is partial common of A1 and B1 cell then Outcome- common words of both cell A1 and B1
    Address is not matching of A1 and B1 cell then Outcome- False.

    For example:

    A1: 399,SADAR BAZAR,JHANSHIMR. RADHA MOHAN AGRAWAL,PH-0517-2472580,9839214980
    B1: 399,SADAR BAZAR,JHANSHIMR


    Outcome (c1): . 399,SADAR BAZAR,JHANSHIMR

    A1: UMA SHANKAR SINGH, GHAZIPUR VILLAGE TARANPUR,POST JUNGIPUR
    B1: VILLAGE TARANPUR,POST JUNGIPUR, GHAZIPUR SHANKAR, Uttar Pradesh

    Outcome (C1): VILLAGE TARANPUR,POST JUNGIPUR, GHAZIPUR SHANKAR

    For the example am attaching original sheet named sample;

    Now i would like you to please write a module to help this out.
    I have 1000's of these kind of rows to be compared, I hope any of you can give me a hand on this, thanks :-)
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Extract common text strings between two cells A1 B1

    Perhaps a custom function like this, so you would enter =x(A2,B2) in C2 and copy down.
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-21-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract common text strings between two cells A1 B1

    Dear StephenR,

    Thanks for your prompt reply; although the formula is working fine but there are still some cases where the output is null; can you check these cases after putting the function in given Example file... filter the blank field please.

    Example:
    A1: Hazi refik 9336644848 Plot No.49 Roti Godam Sitapur SITAPUR
    B1: Plot No.49 Roti Godam Sitapur SITAPUR

    Outupt: Null

    required outupt: Plot No.49 Roti Godam Sitapur SITAPUR

    thanks in advance.
    Sj

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Extract common text strings between two cells A1 B1

    So it has to match any words, not just strings separated by commas?

  5. #5
    Registered User
    Join Date
    11-21-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract common text strings between two cells A1 B1

    Quote Originally Posted by StephenR View Post
    So it has to match any words, not just strings separated by commas?
    Yes sir, you are right, i want any common text, numbers., signs... whatever is common in both cells as an outcome in desired cell.. i hope u can help me out.
    Last edited by ghost_chip; 11-23-2012 at 09:29 AM.

  6. #6
    Registered User
    Join Date
    11-21-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract common text strings between two cells A1 B1

    Hi,

    Thanks for your precious efforts StephenR, i guess you got busy somewhere; i request to the rest of ppl to contribute in the same regards,

    what i need is to compare a text with another text... and extract the common text.

    pls reply.

  7. #7
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Extract common text strings between two cells A1 B1

    Yes, sorry I have been, but will try to look at this tomorrow (Thursday).

  8. #8
    Registered User
    Join Date
    11-21-2012
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Extract common text strings between two cells A1 B1

    Quote Originally Posted by StephenR View Post
    Yes, sorry I have been, but will try to look at this tomorrow (Thursday).
    Thanks sir for replying, hopefully you can help me in a better way
    i will wait for your execution.

    Regards,
    Sj

  9. #9
    Registered User
    Join Date
    11-13-2012
    Location
    Manila
    MS-Off Ver
    Excel 2003, 2010
    Posts
    1

    Re: Extract common text strings between two cells A1 B1

    Hey. I have the same problem and play around with the code written by StephenR and hit my target.

    Maybe you can still make use of this.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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