+ Reply to Thread
Results 1 to 4 of 4

Help With counting rows with multiple criteria

  1. #1
    Registered User
    Join Date
    01-26-2019
    Location
    Michigan, USA
    MS-Off Ver
    2010
    Posts
    2

    Help With counting rows with multiple criteria

    I have a data sheet with thousands on lines of data. Each row consists of answers to multiple yes/no questions. I need to be able to count the number of ROWS where yes appears more than 3 times in that row. I know how to count the number of times yes appears in the row, but now how to count the cows where yes appears 3 or more times. The problem is, I need this to be done in a single formula lines. I can not add any rows to make it a two step process. Any help would be greatly appreciated. Thank you

  2. #2
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help With counting rows with multiple criteria

    Hello kbrand888. Welcome to the forum.

    With data as below try this formula.


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This formula is specific to 5 columns. Adjust as necessary.


    A
    B
    C
    D
    E
    F
    G
    1
    Yes
    no
    no
    Yes
    Yes
    9
    In F1: =SUMPRODUCT(--(MMULT(--($A$1:$E$17="Yes"),{1;1;1;1;1})>=3))
    2
    Yes
    Yes
    no
    Yes
    Yes
    3
    Yes
    no
    Yes
    Yes
    no
    4
    no
    no
    no
    Yes
    no
    5
    no
    Yes
    no
    Yes
    no
    6
    no
    Yes
    Yes
    no
    Yes
    7
    Yes
    no
    no
    no
    Yes
    8
    Yes
    Yes
    Yes
    no
    no
    9
    no
    Yes
    Yes
    no
    no
    10
    Yes
    no
    Yes
    Yes
    no
    11
    no
    Yes
    Yes
    Yes
    no
    12
    no
    Yes
    no
    Yes
    no
    13
    no
    no
    Yes
    no
    Yes
    14
    no
    Yes
    Yes
    no
    Yes
    15
    no
    Yes
    Yes
    no
    no
    16
    no
    Yes
    Yes
    no
    Yes
    17
    Yes
    Yes
    no
    no
    no
    Dave

  3. #3
    Registered User
    Join Date
    01-26-2019
    Location
    Michigan, USA
    MS-Off Ver
    2010
    Posts
    2
    Quote Originally Posted by FlameRetired View Post
    Hello kbrand888. Welcome to the forum.

    With data as below try this formula.


    Formula: copy to clipboard
    Please Login or Register  to view this content.
    This formula is specific to 5 columns. Adjust as necessary.


    A
    B
    C
    D
    E
    F
    G
    1
    Yes
    no
    no
    Yes
    Yes
    9
    In F1: =SUMPRODUCT(--(MMULT(--($A$1:$E$17="Yes"),{1;1;1;1;1})>=3))
    2
    Yes
    Yes
    no
    Yes
    Yes
    3
    Yes
    no
    Yes
    Yes
    no
    4
    no
    no
    no
    Yes
    no
    5
    no
    Yes
    no
    Yes
    no
    6
    no
    Yes
    Yes
    no
    Yes
    7
    Yes
    no
    no
    no
    Yes
    8
    Yes
    Yes
    Yes
    no
    no
    9
    no
    Yes
    Yes
    no
    no
    10
    Yes
    no
    Yes
    Yes
    no
    11
    no
    Yes
    Yes
    Yes
    no
    12
    no
    Yes
    no
    Yes
    no
    13
    no
    no
    Yes
    no
    Yes
    14
    no
    Yes
    Yes
    no
    Yes
    15
    no
    Yes
    Yes
    no
    no
    16
    no
    Yes
    Yes
    no
    Yes
    17
    Yes
    Yes
    no
    no
    no
    Would i be able to adjust this for infinate rows? Data is added to this sheet monthly as its automated so i dont know the number of rows being added. Thank you for the quick response. Its greatly appreciated.

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Help With counting rows with multiple criteria

    Yes. It's easier if you use a Table. If you are not aware of it Tables size themselves automatically to fit the data. Then you could reference the table by name using ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you have never used Tables before it is a good idea to supply your preferred headers above the yes/no columns. Otherwise Excel provides the default Column1, Column2 ...


    And BTW please refrain from quoting whole posts. It's just clutter. A few lines relevant to your post is sufficient. Thanks


    A
    B
    C
    D
    E
    F
    G
    1
    Resp1
    Resp2
    Resp3
    Resp4
    Resp5
    9
    In F1: =SUMPRODUCT(--(MMULT(--(Table1="Yes"),ROW(INDIRECT("1:"&COLUMNS(Table1)))^0)>=3))
    2
    Yes
    no
    no
    Yes
    Yes
    3
    Yes
    Yes
    no
    Yes
    Yes
    4
    Yes
    no
    Yes
    Yes
    no
    5
    no
    no
    no
    Yes
    no
    6
    no
    Yes
    no
    Yes
    no
    7
    no
    Yes
    Yes
    no
    Yes
    8
    Yes
    no
    no
    no
    Yes
    9
    Yes
    Yes
    Yes
    no
    no
    10
    no
    Yes
    Yes
    no
    no
    11
    Yes
    no
    Yes
    Yes
    no
    12
    no
    Yes
    Yes
    Yes
    no
    13
    no
    Yes
    no
    Yes
    no
    14
    no
    no
    Yes
    no
    Yes
    15
    no
    Yes
    Yes
    no
    Yes
    16
    no
    Yes
    Yes
    no
    no
    17
    no
    Yes
    Yes
    no
    Yes
    18
    Yes
    Yes
    no
    no
    no
    Last edited by FlameRetired; 01-26-2019 at 11:50 PM.

+ 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. Replies: 4
    Last Post: 09-15-2017, 01:51 AM
  2. [SOLVED] Counting cells that meet multiple single criteria as variable criteria
    By BillBasil in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-01-2016, 10:33 AM
  3. Counting rows based on multiple criteria
    By PartisanStar in forum Excel General
    Replies: 8
    Last Post: 08-28-2014, 02:59 AM
  4. [SOLVED] counting cells/rows across multiple criteria (columns)
    By vf_guy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-19-2014, 10:06 PM
  5. 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
  6. Replies: 3
    Last Post: 03-01-2012, 06:17 AM
  7. counting rows with multiple criteria within same range
    By *Barb* in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2011, 10:01 AM

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