+ Reply to Thread
Results 1 to 10 of 10

Comparing 2 Strings and output the difference

  1. #1
    Registered User
    Join Date
    11-22-2013
    Location
    Bronx
    MS-Off Ver
    Excel 2003
    Posts
    4

    Cool Comparing 2 Strings and output the difference

    Hi,

    I am trying to compare A1 = ABCD to A2 = ABCDEFGHIJKLMNOPQRSTUVWXYZ and out put on A3 the missing letters of A1.

    Anyone could help, really appreciated.

    Thank You.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Comparing 2 Strings and output the difference

    Perhaps =substitute(a2, a1, "")
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    11-22-2013
    Location
    Bronx
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Comparing 2 Strings and output the difference

    Hi shg,

    Thank you for the prompt response, but I need that A3 contains what is in A2 excluding the character that are in A1.

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Comparing 2 Strings and output the difference

    Please see attached file
    Attached Files Attached Files
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    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,944

    Re: Comparing 2 Strings and output the difference

    Quote Originally Posted by alugo004 View Post
    Hi shg,

    Thank you for the prompt response, but I need that A3 contains what is in A2 excluding the character that are in A1.
    That is exactly what shg's formula does...
    Data Range
    A
    1
    ABCD
    2
    ABCDEFGHIJKLMNO
    3
    EFGHIJKLMNO
    4
    =SUBSTITUTE(A2,A1,"")

    What are you getting?
    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

  6. #6
    Registered User
    Join Date
    11-22-2013
    Location
    Bronx
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Comparing 2 Strings and output the difference

    Hi FDibbins,

    I am getting the following:

    A1= ABCD
    A2= ABCDEFGHIJKLMNOPQRSTUVWXYZ
    A3= ABCDEFGHIJKLMNOPQRSTUVWXYZ
    Formula =substitute(A2,A1,"").

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Comparing 2 Strings and output the difference

    Hi,

    Are you sure your letters in both A1 and A2 are all upper case?

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  8. #8
    Registered User
    Join Date
    11-22-2013
    Location
    Bronx
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Comparing 2 Strings and output the difference

    Yeah, I made sure all was the same and all formats, but thank you all for the dedicated help.

    I was able to use Alkey file, thank you.

    Again, thank you all for the help!

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Comparing 2 Strings and output the difference

    You're welcome. Don't forget to thank those who helped by clicking on Add Reputation * and please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

  10. #10
    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,944

    Re: Comparing 2 Strings and output the difference

    I didnt do much, but thanks for the feedback

+ 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. find if the difference between 2 strings is , . or [space]
    By cool_anu4u in forum Excel General
    Replies: 5
    Last Post: 10-31-2013, 05:42 AM
  2. Compare two strings and output the differences
    By aliastx in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-14-2013, 10:49 PM
  3. [SOLVED] Comparing two cells for similarities and output a third cell (if C1 = B1, then output A1)
    By PERFECT777 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-26-2013, 12:37 AM
  4. Can You Output Differences Among Strings?
    By ilikeexcel in forum Excel General
    Replies: 3
    Last Post: 11-18-2011, 06:04 PM
  5. How do I search Strings and get an output?
    By dziw in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2007, 02:26 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