+ Reply to Thread
Results 1 to 5 of 5

need help with counting items in row/colums

  1. #1
    Registered User
    Join Date
    09-19-2011
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    10

    need help with counting items in row/colums

    Ok here it is I am try to count the number of time 2 different items show up in the same row in the data set. so I have an example in numbers for you. Lets say I want to know how may times the numbers 2 and 3 show up together in a row. The numbers are all in different cells.
    1,2,3
    2,3,4
    1,3,4

    in the example if we count we get the answer would be 2 times.
    Now lets count how many times 2 and 4 are together in a row. The answer would be 1 time. I need a formula that would look at the date and give me the answer. I don't know how to do this and have been working on it for a few weeks.
    Thanks
    Last edited by andycouch; 09-20-2011 at 10:25 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: need help with a hard formula

    Hello andy,

    Welcome to excelforum, we'd love to help but we do insist on the rules being adhered to. Rule 1 says that thread titles should accurately describe your problem. "need help with a hard formula" could probably apply to 50% of the questions here - please amend - thanks
    Audere est facere

  3. #3
    Registered User
    Join Date
    09-19-2011
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with a hard formula

    I think I fixed the question.
    Thanks

  4. #4
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: need help with counting items in row/colums

    Thanks for that andy,

    Are the numbers unique within each row? If so then if you have data in A2:C10 this formula will count rows that contain 2 and 3

    =SUMPRODUCT((MMULT((A2:C10=2)+(A2:C10=3),{1;1;1})>1)+0)

    Note that the {1;1;1} part is determined by the number of columns you have...so for a 4 column range change to {1;1;1;1} etc. That part could be automated within the formula to cope with variable width ranges but it takes some more effort........

  5. #5
    Registered User
    Join Date
    09-19-2011
    Location
    NC
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: need help with counting items in row/colums

    Thank you so much that solved the problem. I wish I know more about the MMULT it fixed what I could not figure you.
    thanks again for the help and getting me started. Your the best
    Andy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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