+ Reply to Thread
Results 1 to 14 of 14

How do I count trio in excel?

  1. #1
    Registered User
    Join Date
    11-12-2010
    Location
    são paulo, brazil
    MS-Off Ver
    Excel 2007
    Posts
    25

    How do I count trio in excel?

    Good afternoon,

    I have the following table:

    02 03 05 06 09 10 11 13 14 16 18 20 23 24 25
    01 04 05 06 07 09 11 12 13 15 16 19 20 23 24
    01 04 06 07 08 09 10 11 12 14 16 17 20 23 24
    01 02 04 05 08 10 12 13 16 17 18 19 23 24 25
    01 02 04 08 09 11 12 13 15 16 19 20 23 24 25
    01 02 04 05 06 07 10 12 15 16 17 19 21 23 25
    01 04 07 08 10 12 14 15 16 18 19 21 22 23 25
    01 05 06 08 09 10 13 15 16 17 18 19 20 22 25
    03 04 05 09 10 11 13 15 16 17 19 20 21 24 25
    02 03 04 05 06 08 09 10 11 12 14 19 20 23 24
    02 06 07 08 09 10 11 12 16 19 20 22 23 24 25
    01 02 04 05 07 08 09 10 11 12 14 16 17 24 25
    03 05 06 07 08 09 10 11 13 14 15 16 17 19 23
    01 02 05 06 07 09 13 14 15 18 19 20 21 23 25
    01 02 04 06 08 10 12 15 16 18 19 21 23 24 25
    02 05 06 07 08 10 12 13 15 17 19 21 23 24 25
    01 02 03 05 06 07 09 13 14 16 17 18 19 20 21
    02 06 07 08 10 11 14 15 17 18 19 20 22 23 24
    02 05 06 07 08 10 11 13 14 15 16 17 20 23 24
    03 04 06 07 08 09 10 14 16 17 18 19 20 23 24

    I would like know how to calculate the trio number of repetitions below:
    06 10 23
    09 19 20
    01 16 25
    02 07 10
    04 09 12

    I know the answer is:
    Trio - number of times that are repeated
    06 10 23 - 11
    09 19 20 - 09
    01 16 25 - 07
    02 07 10 - 06
    04 09 12 - 05

    But I can not make a formula or argument to do is count in excel.

    Can anyone help me?

    Regards,

    Rafael

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How do I count trio in excel?

    With this table in cells A1:O20...

    02 03 05 06 09 10 11 13 14 16 18 20 23 24 25
    01 04 05 06 07 09 11 12 13 15 16 19 20 23 24
    01 04 06 07 08 09 10 11 12 14 16 17 20 23 24
    01 02 04 05 08 10 12 13 16 17 18 19 23 24 25
    01 02 04 08 09 11 12 13 15 16 19 20 23 24 25
    01 02 04 05 06 07 10 12 15 16 17 19 21 23 25
    01 04 07 08 10 12 14 15 16 18 19 21 22 23 25
    01 05 06 08 09 10 13 15 16 17 18 19 20 22 25
    03 04 05 09 10 11 13 15 16 17 19 20 21 24 25
    02 03 04 05 06 08 09 10 11 12 14 19 20 23 24
    02 06 07 08 09 10 11 12 16 19 20 22 23 24 25
    01 02 04 05 07 08 09 10 11 12 14 16 17 24 25
    03 05 06 07 08 09 10 11 13 14 15 16 17 19 23
    01 02 05 06 07 09 13 14 15 18 19 20 21 23 25
    01 02 04 06 08 10 12 15 16 18 19 21 23 24 25
    02 05 06 07 08 10 12 13 15 17 19 21 23 24 25
    01 02 03 05 06 07 09 13 14 16 17 18 19 20 21
    02 06 07 08 10 11 14 15 17 18 19 20 22 23 24
    02 05 06 07 08 10 11 13 14 15 16 17 20 23 24
    03 04 06 07 08 09 10 14 16 17 18 19 20 23 24

    And this table in cells R1:T5...
    06 10 23
    09 19 20
    01 16 25
    02 07 10
    04 09 12

    This regular formula counts the number of times the referenced trio occurs within a row:
    Please Login or Register  to view this content.
    Copy that formula down through U5.

    These will be the results in U1:U5
    11
    9
    7
    6
    5

    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    11-12-2010
    Location
    são paulo, brazil
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How do I count trio in excel?

    Mr. Ron

    Is that something you can work with?
    Answer: more or less, II intend to use in a set called Lotofacil games in Brazil, I would like to understand the formula to be able to change to 7 combinations, because I have an interesting program with some filters but I'm having problems with this formula as you can see ...

    When I wrote the formula appeared in the error underlined item.
    =SUMPRODUCT(--(FREQUENCY(--((($A$1:$O$20=R1)*ROW($A$1:$A$20))+(($A$1:$O$20=S1)*ROW($A$1:$A$20))+(($A$1:$O$20=T1)*ROW($A$1:$A$20))),ROW($A$1:$A$21)-1)=3))

    Can you explain me what happens here?

    Rafael
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by rafa.jsilva; 11-13-2010 at 07:08 AM.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: How do I count trio in excel?

    To best describe or illustrate your problem you would be better off attaching a dummy workbook instead of images, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: How do I count trio in excel?

    Another approach, using VBA:

    Please Login or Register  to view this content.
    In x1...x5 the frequency of the respective combinations.

    In x7 an example how to use this method with a combination of 7 numbers



  6. #6
    Registered User
    Join Date
    11-12-2010
    Location
    são paulo, brazil
    MS-Off Ver
    Excel 2007
    Posts
    25

    Thumbs up Re: How do I count trio in excel?

    Guys, sorry by bad explanation that I wanted to give. What I want is in attachment in excel file. I would know how times there is a repetition to each possibility of game.
    eg: numbers 1-2-3-4-5-6-7 were repeated 7 times.

    regards,

    Rafael
    Attached Files Attached Files

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: How do I count trio in excel?

    each possibility is (If I make it right):

    (25-7)!*7! / 25! = 2,1 e-6

    In other words: 480700 combinations

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How do I count trio in excel?

    Quote Originally Posted by rafa.jsilva View Post
    Mr. Ron
    When I wrote the formula appeared in the error underlined item.
    =SUMPRODUCT(--(FREQUENCY(--((($A$1:$O$20=R1)*ROW($A$1:$A$20))+(($A$1:$O$20=S1)*ROW($A$1:$A$20))+(($A$1:$O$20=T1)*ROW($A$1:$A$20))),ROW($A$1:$A$21)-1)=3))

    Can you explain me what happens here?

    Rafael
    The problem in the workbook you attached is that you changed the comma before the last ROW function into a plus-sign:
    This: +ROW($A$1:$A$21)-1)=3))
    Should be this: ,ROW($A$1:$A$21)-1)=3))

  9. #9
    Registered User
    Join Date
    11-12-2010
    Location
    são paulo, brazil
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How do I count trio in excel?

    Quote Originally Posted by Ron Coderre View Post
    The problem in the workbook you attached is that you changed the comma before the last ROW function into a plus-sign:
    This: +ROW($A$1:$A$21)-1)=3))
    Should be this: ,ROW($A$1:$A$21)-1)=3))
    Mr. Ron,

    I changed the command as you mentioned but it returns me the same error that the picture attached in the second message in our conversations

    Can you do this command in the attachment that I sent and make available on the site? So I will understand what I missed.

    Rafael

  10. #10
    Registered User
    Join Date
    11-12-2010
    Location
    são paulo, brazil
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How do I count trio in excel?

    Quote Originally Posted by snb View Post
    Another approach, using VBA:

    Please Login or Register  to view this content.
    In x1...x5 the frequency of the respective combinations.

    In x7 an example how to use this method with a combination of 7 numbers
    Guy,

    I don't understand nothing about VBA. If possible Can you insert this argument at excel file that is in last conversation. So I could to understand better.

    Thanks

  11. #11
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How do I count trio in excel?

    I attached an edited version of your workbook with working formulas. If it displays as an error in your PC, perhaps the problem occurs because of regional settings differences. Your formula separator may be a semi-colon, instead of a comma.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-12-2010
    Location
    são paulo, brazil
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How do I count trio in excel?

    Ron,

    You are genius... Your formula are working perfectly... I'm trying to understand to use in repetition file(file last posted), but if you help me before I'll be thankful.

    Regards,

    Rafael

  13. #13
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: How do I count trio in excel?

    Try the attached, edited version of your file.

    This is one of the formulas it uses:
    Please Login or Register  to view this content.
    Note: I replaced the spaces in the sheet names with underscores "_" to reduce punctuation and improve formula readability.

    I hope that helps.
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    11-12-2010
    Location
    são paulo, brazil
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: How do I count trio in excel?

    Problem solved.

    Thank you all

    Rafael

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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