+ Reply to Thread
Results 1 to 4 of 4

Compare two cells for identical or shared letters

  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    navarre, fl
    MS-Off Ver
    Excel 2010
    Posts
    2

    Compare two cells for identical or shared letters

    I am new to the forum but have been using Excel for about a decade now though I have never gotten into formulas very deeply. I have a simple problem that I need help with from someone more expert then I. The problem is how to compare two cells each with two letters and mark in a third cell on the same row whether the two cells share any letters in common. for example:

    AA AT
    CC TT
    TT CT
    GG GG

    I want to have rows 1 and 3 show a match since row 1 cells share an A and row 3 shares a T.
    Row two should show no match since its cells share no letters.
    The bottom row should, of course, also show a match since all letters are shared

    I have vast columns of these genotypes and need for Excel to tell me at a glance which cells share letters and which don't.
    I also need the "match" or "no match" in a third column to allow me to sort by that column.
    Thanks in advance for any solution.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Compare two cells for identical or shared letters

    Hi there, give this formula a shot, it looks at Cells A1 and B1, and is intended to be placed in C1, and filled downward

    =IF(OR(ISNUMBER(FIND(LEFT(B1,1),A1)),ISNUMBER(FIND(RIGHT(B1,1),A1))),"Match","No Match")
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    04-13-2012
    Location
    navarre, fl
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Compare two cells for identical or shared letters

    Hi DGagnon,

    Absolutely it worked. A million thanks and it only took 9 minutes from ask to answer.

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: Compare two cells for identical or shared letters

    no problem, glad i could help you out.

    could you pleae mark this thread as solved?

+ 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