+ Reply to Thread
Results 1 to 10 of 10

Count number of Rows with multiple criteria (multiple valued cells)

  1. #1
    Registered User
    Join Date
    03-09-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    5

    Exclamation Count number of Rows with multiple criteria (multiple valued cells)

    Hello!

    I'm fairly new to excel and to this forum.

    I'll just be straight about my problem

    Here's a part of my data

    A B C
    1 1,2 1,4
    2 1,3,4 2,3
    1 1,4 2
    1 3,4 2,3
    2 1 1

    So what i wanted to know is how do i get the number of data with A=1, B=4, C=2 so the result will be 2

    So far, i've been using SUMPRODUCT to some of my data, apparently, it doesn't work when it comes to cells with "comma"

    I tried using =sumproduct((A:A=1)*(B:B=4)(C:C=2))
    it doesn't work because of the comma's

    I need help

    thanks!
    Last edited by garog; 03-09-2014 at 05:44 AM.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,366

    Re: I need help in a certain formula

    How come the results is 2 when you try to sum A=1 B=4 and C=2

  3. #3
    Registered User
    Join Date
    03-09-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: I need help in a certain formula

    Maybe i'm using a wrong function or formula. I'm sorry for that. What i meant to do was a criteria function. It would count the number of rows with having "1" in column A, "4" in column B and "2" in column C. So the result would be 2. Some of the cells though have "commas", i don't know how it would affect the formula. I hope you understand since my english is very rusty. Thanks!

  4. #4
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,366

    Re: I need help in a certain formula

    Assumed your data in range: A1:C5

    =SUMPRODUCT(--(A1:A5=B7),--ISNUMBER(SEARCH(B8,B1:B5)),--ISNUMBER(SEARCH(B9,C1:C5)))

    B7=1
    B8=4
    B9=2

    Hope it helps
    Attached Files Attached Files
    Last edited by azumi; 03-09-2014 at 05:17 AM.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: I need help in a certain formula

    Hi, garog,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  6. #6
    Registered User
    Join Date
    03-09-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: I need help in a certain formula

    this is helpful! I still have a problem though, some of the numbers in a cell ranged from 1-40. So if a row having "1" in column A, "4" in column B and "22" or any other number with "2" in column C, it includes it in the count. This is a real problem, i have thousand of rows for this.

  7. #7
    Registered User
    Join Date
    03-09-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: I need help in a certain formula

    Quote Originally Posted by HaHoBe View Post
    Hi, garog,

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)

    Ciao,
    Holger
    Hello! i'm sorry, i've changed the title now. :D

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: I need help in a certain formula

    Thanks for changing the thread title!

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Header
    Header
    Header
    -----
    Find
    Find
    Find
    Count
    2
    1
    1,2
    1,4
    1
    4
    2
    2
    3
    2
    1,3,4
    2,3
    4
    1
    1,4
    2
    5
    1
    3,4
    2,3
    6
    2
    1
    1


    This formula entered in H2:

    =SUMPRODUCT(--ISNUMBER(FIND(","&E2&",",","&A2:A6&",")),--ISNUMBER(FIND(","&F2&",",","&B2:B6&",")),--ISNUMBER(FIND(","&G2&",",","&C2:C6&",")))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Registered User
    Join Date
    03-09-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: I need help in a certain formula

    Quote Originally Posted by Tony Valko View Post
    Thanks for changing the thread title!

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    1
    Header
    Header
    Header
    -----
    Find
    Find
    Find
    Count
    2
    1
    1,2
    1,4
    1
    4
    2
    2
    3
    2
    1,3,4
    2,3
    4
    1
    1,4
    2
    5
    1
    3,4
    2,3
    6
    2
    1
    1


    This formula entered in H2:

    =SUMPRODUCT(--ISNUMBER(FIND(","&E2&",",","&A2:A6&",")),--ISNUMBER(FIND(","&F2&",",","&B2:B6&",")),--ISNUMBER(FIND(","&G2&",",","&C2:C6&",")))
    This is very helpful! thank you! I already like this forum

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: I need help in a certain formula

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04: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