+ Reply to Thread
Results 1 to 7 of 7

Building a formula to count the number of matches between 8 different columns

  1. #1
    Registered User
    Join Date
    05-19-2016
    Location
    Cambridge, Ontario
    MS-Off Ver
    2010
    Posts
    47

    Building a formula to count the number of matches between 8 different columns

    Hi all!

    I've been struggling with this for some time so i thought i would ask the experts. I am trying to build a formula that will count the amount of times Team Members (TMs) do a KC (left collumn) together. To determine this, I need for at least THREE of the 8 columns (i.e. leader + advisor + TM 1 OR TM 1 + TM 2 + TM 3, etc.) to match.

    IF there are THREE OR MORE matches in multiple rows, that's what im concerned with finding.

    The problem I am having is that i can't simply do a COUNTIFS and try to match 3 of the cells to the rest of the column because a TM that was in column D for a specific KC # (column A), could be in column F (or G, H, I, J or K) for another KC #.


    If anyone has any advice for how this might be done, feel free to share. Any help is greatly appreciated.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Building a formula to count the number of matches between 8 different columns

    try this Array Formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    where TRUE means that there are THREE OR MORE matches.

    Note: Array Formula must be entered/confirmed using Ctrl + Shift + Enter

  3. #3
    Registered User
    Join Date
    05-19-2016
    Location
    Cambridge, Ontario
    MS-Off Ver
    2010
    Posts
    47

    Re: Building a formula to count the number of matches between 8 different columns

    ahh so close! It's a good idea, but unfortunately what happens is that some of the values occur in different KC's but with different TMs. So the value will still be counted. I needed it to say if 3 or More are together in one of the KC's and they're also together in another KC THEN return a "TRUE". This is counting any time the values reoccur independent of the adjacent cells (the other TMs in the KC) and then returning a value for how many times that happens.

  4. #4
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Re: Building a formula to count the number of matches between 8 different columns

    I'm sorry, you've lost me. Please show the different matches/counts as you are describing in words above. Attach an example that clearly shows the different possible outcomes and the desired formula result in each case.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Building a formula to count the number of matches between 8 different columns

    This falls into the "Any help is greatly appreciated" category as opposed to being a solution. My first thought was that if I could get a table of KC ID#'s vs. TM#'s I could then get excel to find matches in more than one column or row. Making a list of unique TM#'s quickly used up my laptops resources causing the process to take several minutes. I came up with a table that would count how many times a TM served on a KC, with the logic being that if a TM only served on one KC there would be no opportunity to do another KC with members of that team. The formula used in the blue shaded portion of Sheet1 is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Next thought was that I could further reduce by selecting only KC's that had three or more team members meeting with 'Counts' of 2+. The green shaded column that accomplishes this uses the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Finally I got the actual TM#'s, yellow shaded portion, using the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This reduced the number of candidate TM#'s by 2/3 giving the laptop a chance to complete the unique list (Sheet2 column A) in a reasonable amount of time, using the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Also reduced are the KC candidates (Sheet2 row 1) based on the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    The table is then populated using the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This provides a visual aid for finding 'Three Or More matches'. Note: the portion of sheet one shaded pink was an unsuccessful attempt to have excel identify the KC's in which the 'Three Or More matches' criteria had been met. I am leaving it in the attached file so that others can see if there is a way to complete the process or get some inspiration for a successful solution.
    Let me know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  6. #6
    Registered User
    Join Date
    05-19-2016
    Location
    Cambridge, Ontario
    MS-Off Ver
    2010
    Posts
    47

    Re: Building a formula to count the number of matches between 8 different columns

    Thank you Jete! I had pretty much given up on this but I'll try it out!

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,540

    Re: Building a formula to count the number of matches between 8 different columns

    Thanks for the feedback, would like to know what you think after you have a chance to try it out.

+ 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] Count number of occurrences but if there are consecutive matches count them as one
    By michaljireht in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-26-2013, 08:26 PM
  2. Replies: 7
    Last Post: 03-25-2013, 06:07 PM
  3. Replies: 5
    Last Post: 01-05-2013, 01:28 AM
  4. [SOLVED] count how many times one number matches to a data field
    By Chubster in forum Excel General
    Replies: 2
    Last Post: 10-16-2012, 08:20 AM
  5. Excel 2007 : Vlookup to count matches in two columns
    By notwen in forum Excel General
    Replies: 4
    Last Post: 06-10-2011, 06:29 AM
  6. Replies: 3
    Last Post: 11-13-2007, 05:13 PM
  7. Count if number matches critera
    By lazyme in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2007, 04:52 PM
  8. How do I count number of cels the matches 2 conditions ?
    By Abra in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-27-2005, 05:06 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