+ Reply to Thread
Results 1 to 5 of 5

Count Total Number of Matching Cells Across Two Columns

  1. #1
    Registered User
    Join Date
    06-27-2011
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    2

    Count Total Number of Matching Cells Across Two Columns

    Greetings,

    I work in a call center and work with large spread sheets that sometimes contain more than 25,000 rows of information regarding individual phone interactions with clients. One column contains a time stamp from when a client's profile was created. The adjacent column contains a time stamp for the individual conversation. If the information in two adjacent cells matches, that indicates that the conversation was with a first-time caller. I need a formula that will count the number of times two adjacent cells within these two columns match one another.

    If at all possible, I’d like to avoid an approach that requires creating another column, inserting a formula and dragging down to the final row. In the example workbook I’ve posted, there are 9 rows whose data is matching. A formula that could be placed in a single cell and calculate those nine instances would be excellent.

    Thanks so much for your help.
    Attached Files Attached Files
    Last edited by smcc771; 06-30-2011 at 04:23 PM.

  2. #2
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Count Total Number of Matching Cells Across Two Columns

    Hello, Try any of these,

    =SUMPRODUCT(--(A2:A14=B2:B14))

    =SUMPRODUCT(--ISNUMBER(MATCH($A$2:$A$14,$B$2:$B$14,0)))

    If you have huge data, this may slow the calculation.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  3. #3
    Registered User
    Join Date
    06-27-2011
    Location
    Colorado
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Count Total Number of Matching Cells Across Two Columns

    Hi Haseeb. Thanks for the quick reply!

    The first formula worked well for this specific sheet but it occurred to me that I left out an important piece of information in my explanation of what I'm looking for. I'm creating a template for analyzing worksheets like the one I posted and the number of rows in those worksheets varies from a few hundred to tens of thousands. It would be ideal if the formula could calculate the matching cells for the entire column without having to annotate the range of cells (In this case A2:A14 and B2:B14). This would allow me to plug in my spreadsheets (huge or small) and have the numbers calculated without having to make any modifications to the formula.

    Thanks for your help and sorry for the miscommunication.

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Count Total Number of Matching Cells Across Two Columns

    The easiest way is to just pick a row number that you never think you'll exceed, e.g. A2:A20000 and B2:B20000. I believe in Excel 2007+ you can reference whole columns in SUMPRODUCT formulas (in Excel 2003- you can't), but be advised that this could greatly impact performance.

  5. #5
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Count Total Number of Matching Cells Across Two Columns

    Or define a dynamic named range & use it in SUMPRODUCT

+ 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