+ Reply to Thread
Results 1 to 10 of 10

Compare two cells and pick up the common number..help and thanks.

  1. #1
    Registered User
    Join Date
    10-19-2013
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Question Compare two cells and pick up the common number..help and thanks.

    Hi everyone. I am new here. I'm trying to compare two sets of numbers in two cells and then pick the common number(s).

    For example:

    A1: 123
    A2: 345

    In this case, the common number is the number 3. So what is the correct formula I need in cell A3 so that it will show the number 3? Sorry, I'm just too newbie.. Thanks for helping.

  2. #2
    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: Compare two cells and pick up the common number..help and thanks.

    Hi NEW2006 and welcome to the forum

    What if there is more than one match?
    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

  3. #3
    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: Compare two cells and pick up the common number..help and thanks.

    Copy this formula and paste it in C1 and drag it across to H1 and one row down

    =MID($A1,COLUMN(A1),1)

    Copy and paste this formula in cell C3 and drag it across to H3

    =IFERROR(VALUE(INDEX($C$1:$H$1,MATCH(C2,$C$1:$H$1,0))),"")

    A
    B
    C
    D
    E
    F
    G
    H
    1
    123
    1
    2
    3
    2
    345
    3
    4
    5
    3
    3
    4

  4. #4
    Registered User
    Join Date
    10-19-2013
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Compare two cells and pick up the common number..help and thanks.

    Quote Originally Posted by AlKey View Post
    Hi NEW2006 and welcome to the forum

    What if there is more than one match?
    Very good quetion. If there are more than one match then show all them.

    Example:
    A1: 12345
    A2: 34678

    In this case 34 are the common numbers, so just show 34 in cell A3. Thanks for the help on this.

  5. #5
    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: Compare two cells and pick up the common number..help and thanks.

    Pleas see attached file.
    Attached Files Attached Files

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

    Re: Compare two cells and pick up the common number..help and thanks.

    Hi,

    Are you always interested in comparing single-digit integers only? So you'll never be looking to see if e.g. 13 occurs in both lists (since this will be effectively two comparions - for 1 and for 3)?

    Is there an upper limit on the number of digits that each cell can contain?

    Regards
    Click * below if this answer helped

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

  7. #7
    Registered User
    Join Date
    10-19-2013
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Compare two cells and pick up the common number..help and thanks.

    Awesome work Alkey. It work! Thanks for the help. I'm very appreciated. Thanks again.

  8. #8
    Registered User
    Join Date
    10-19-2013
    Location
    usa
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Compare two cells and pick up the common number..help and thanks.

    Quote Originally Posted by XOR LX View Post
    Hi,

    Are you always interested in comparing single-digit integers only? So you'll never be looking to see if e.g. 13 occurs in both lists (since this will be effectively two comparions - for 1 and for 3)?

    Is there an upper limit on the number of digits that each cell can contain?

    Regards
    No, there should be no limit of digits in each cells. Though 0-9 is all the numbers there is.

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

    Re: Compare two cells and pick up the common number..help and thanks.

    Ok, I see now that you're happy with the solution offered you by Alkey, so please mark this thread as solved.

    Regards

  10. #10
    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: Compare two cells and pick up the common number..help and thanks.

    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).

+ 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. [SOLVED] Compare Two Cells & Return Whats Common Between the two strings and delete the variation
    By alfykunable in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 10-24-2020, 02:00 PM
  2. Table to pick out most common entries and count occurences of each
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 09-06-2005, 07:05 PM
  3. [SOLVED] Table to pick out most common entries and count occurences of each
    By Duke Carey in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 04:05 AM
  4. Table to pick out most common entries and count occurences of each
    By Neil Goldwasser in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  5. pick the least common number?
    By alanad in forum Excel General
    Replies: 0
    Last Post: 01-06-2005, 10:42 AM

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