+ Reply to Thread
Results 1 to 12 of 12

Matching two columns from separate sheets

  1. #1
    Registered User
    Join Date
    10-10-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    11

    Matching two columns from separate sheets

    I have a column in a worksheet named ID which contains unique text values like abc14, dad88, etc.

    I have a similar column in the second sheet of the same file, and some of the IDs in each of these sheet are similar, but some only happen on one of the two sheets. I want a formula which can match these columns in count the number of IDs which are present in both of them. I want this number to be shown in a cell in the third sheet.

    If it was only about matching one cell against a column, I could use something similar to this: =IF(ISNUMBER(MATCH(B1,$A$1:$A$7,0)),1,0)

    However, I want the cell to show the total count of matching one column against another column.

    Please help me.
    Last edited by Merik; 10-11-2010 at 12:00 AM.

  2. #2
    Forum Contributor Charlie_Howell's Avatar
    Join Date
    09-27-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Matching two columns from separate sheets

    upload your sheet and lets try and solve this thing...

  3. #3
    Forum Contributor Charlie_Howell's Avatar
    Join Date
    09-27-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Matching two columns from separate sheets

    I'm not sure if this is what you need but a fair attempt I'm sure.
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Matching two columns from separate sheets

    Quote Originally Posted by Merik
    I want a formula which can match these columns in count the number of IDs which are present in both of them. I want this number to be shown in a cell in the third sheet.
    If you want a single cell calculation in the third sheet without need for helps on sheet "ID" then:

    Please Login or Register  to view this content.
    modify ranges to suit but note that with SUMPRODUCT the ranges used should be kept as lean as possible.

  5. #5
    Registered User
    Join Date
    10-10-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Matching two columns from separate sheets

    Thank you guys. I couldn't upload my sheet because it contains private data.

    Now what if I want to match three columns? I want to know the IDs which appear on the A column of Sheet1, A column of Sheet 2 and A column of Sheet3. How do I do that?

  6. #6
    Forum Contributor Charlie_Howell's Avatar
    Join Date
    09-27-2010
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2007
    Posts
    218

    Re: Matching two columns from separate sheets

    Is this what you were looking for?
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-10-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Matching two columns from separate sheets

    No. For me, the solution by DonkeyOte worked for two columns. Now I want it for three columns.

    So simply put, I want the count of ID values on Column A of Sheet 3, which also appear on Column A of Sheet 1 and Column A of Sheet 2.

  8. #8
    Registered User
    Join Date
    10-10-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Matching two columns from separate sheets

    Sheet 1
    ---------------
    ID
    ---------------
    101
    103
    104
    105



    Sheet 2
    ---------------
    ID
    ---------------
    101
    104
    106
    108


    Sheet 3
    ---------------
    ID
    ---------------
    101
    104
    108
    112


    In the above example, the answer I'm looking for is 2, because only two of the IDs (101 and 104) appear on all of the three lists.

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Matching two columns from separate sheets

    Conduct an AND test

    Please Login or Register  to view this content.
    The above will return the Count of items in Sheet1!$B$1:$B$100 that appear in both lists
    (where Sheet1 contains unique items per your original post)

    Modify ranges to suit.

  10. #10
    Registered User
    Join Date
    10-10-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Matching two columns from separate sheets

    Perfect! Thank you

  11. #11
    Registered User
    Join Date
    10-10-2010
    Location
    New Jersey
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Matching two columns from separate sheets

    I can do the same for four or five columns. Thank you

    My last question: Why did we need a -- before ISNUMBER when dealing with two columns, but we don't need it for three or four columns?

  12. #12
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Matching two columns from separate sheets

    For more info. on SUMPRODUCT and coercion see the link in my sig. to Bob Phillips' white paper.

+ 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