+ Reply to Thread
Results 1 to 2 of 2

Counting rows with applicable criteria.

  1. #1
    Registered User
    Join Date
    08-26-2019
    Location
    winnipeg
    MS-Off Ver
    2017
    Posts
    5

    Counting rows with applicable criteria.

    Hey everyone!

    Ok, quick question which may or may not be difficult.

    So I have 150 rows of NFL player names that simulate a 9 player fantasy football lineup, I want to be able to count specific occurrences of a combination of 3 players names in the same row. For example:
    (Keep in mind each one of these names is in its own cell in a row, not one giant cell)

    Kirk Cousins Leonard Fournette Kerryon Johnson DeSean Jackson Stefon Diggs Adam Thielen Austin Hooper Ezekiel Elliott Bengals
    Patrick Mahomes Chris Thompson Leonard Fournette DeSean Jackson Tyreek Hill Sterling Shepard Travis Kelce Joe Mixon Panthers
    Matthew Stafford Leonard Fournette Kerryon Johnson Adam Thielen Danny Amendola Christian Kirk Zach Ertz Ezekiel Elliott Dolphins
    Philip Rivers Leonard Fournette Kerryon Johnson Tyler Lockett T.Y. Hilton Keenan Allen Zach Ertz Hunter Henry 49ers
    Patrick Mahomes Dalvin Cook Chris Carson Marqise Lee Sammy Watkins Tyreek Hill Zach Ertz Kerryon Johnson Panthers
    Kirk Cousins Dalvin Cook Joe Mixon Justin Hardy Adam Thielen Tyreek Hill George Kittle Kerryon Johnson Bengals
    Dak Prescott Leonard Fournette Joe Mixon Calvin Ridley Adam Thielen Sterling Shepard Jason Witten Ezekiel Elliott Dolphins
    Patrick Mahomes Leonard Fournette Damien Williams Adam Thielen Tyreek Hill Sterling Shepard Austin Hooper Chris Carson Panthers
    Matthew Stafford Leonard Fournette Kerryon Johnson Tyreek Hill Christian Kirk Marvin Jones Jordan Reed Ezekiel Elliott Colts
    Kirk Cousins Dalvin Cook Kerryon Johnson Justin Hardy DJ Moore Adam Thielen Zach Ertz Ezekiel Elliott Dolphins
    Nick Foles Leonard Fournette Chris Carson Marqise Lee Robert Woods Tyreek Hill Austin Hooper Ezekiel Elliott Dolphins
    Patrick Mahomes Mark Ingram Leonard Fournette Calvin Ridley Stefon Diggs Tyreek Hill Hunter Henry Damien Williams Bengals
    Jameis Winston Leonard Fournette Joe Mixon Stefon Diggs Breshad Perriman Chris Godwin George Kittle Kerryon Johnson Bengals
    Kirk Cousins Leonard Fournette Joe Mixon Justin Hardy Stefon Diggs Adam Thielen Travis Kelce Kerryon Johnson Panthers

    Each one of these rows is a "lineup", if I want to know how many times say for instance the combination of Kirk Cousins, Stefon Diggs and Adam Thielen all appear in the same row, how would I do this?
    Attached Files Attached Files

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

    Re: Counting rows with applicable criteria.

    Hi,

    Array formula** in O2:

    =SUM(0+(MMULT(COUNTIF(OFFSET(A$1:I$1,ROW(A1:I150)-MIN(ROW(A1:I150)),),L2:N2),{1;1;1})=3))

    Note that the parts in red are static, and relate to the fact that you are looking to count the number of rows for which 3 entries are found. A more general and extendable set-up is:

    =SUM(0+(MMULT(COUNTIF(OFFSET(A$1:I$1,ROW(A1:I150)-MIN(ROW(A1:I150)),),L2:N2),TRANSPOSE(COLUMN(L2:N2)^0))=COLUMNS(L2:N2)))

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Last edited by XOR LX; 08-26-2019 at 02:26 PM.
    Click * below if this answer helped

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

+ 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] Master tab serial number list parsed out to applicable cells in applicable worksheets
    By kiwimtnbkr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-27-2017, 10:57 AM
  2. Identify the dates or date ranges applicable based on a criteria
    By tiggi in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-28-2016, 05:45 AM
  3. [SOLVED] If Column matches criteria, display applicable Rows on another sheet
    By dgroff in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-05-2015, 07:34 PM
  4. Script dict displaying one row instead of all applicable rows ?
    By leanne2011 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-02-2014, 02:58 PM
  5. [SOLVED] Lookup applicable rows and sum values
    By T 520 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2013, 01:09 PM
  6. need help with counting criteria without counting duplicate rows
    By lya in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2012, 10:14 PM
  7. Counting rows with criteria
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-29-2006, 08:10 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