+ Reply to Thread
Results 1 to 24 of 24

Generate random combinations only one number from each group of 4 letters

  1. #1
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Generate random combinations only one number from each group of 4 letters

    Generate random combinations only one number from each group of 4 letters
    https://www.excelforum.com/attachmen...1&d=1510661296
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    7,917

    Re: Generate random combinations only one number from each group of 4 letters

    Where groups A, B, C, D are stored?
    What are their members?

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. (If trere are typical cases like: all unique values/duplicates could occur, day/night, nobody present/several persons at once, before/on/past due, etc. - please show them all or at least indicate in text) The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that both: input data and your desired solution(s) is/are also shown (mock up the results manually).
    Best Regards,

    Kaper

  3. #3
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Hello kaper, but groups of 4 numbers are represented in each distinct color !!!!
    Each color has 4 abcd numbers
    A b 01 15
    C d 51 10
    A = 01
    B = 15
    C = 51
    D = 10

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    7,917

    Re: Generate random combinations only one number from each group of 4 letters

    OK, and next 4 are:
    06 47
    74 60

    Why not
    02 25
    52 20

  5. #5
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Yes we have 45 groups, you have to generate 40 numbers, only one number each group of 4 (given color)
    * The line of 40 numbers always has to pass through the 45 groups (total of groups0 only one number per group
    * The restriction of not being couple of inverted
    Exempl =
    * 02 25
    52 20
    * Or 25 or 02 or 52 or 20 number 4 together just one of each group!

  6. #6
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Hello how will 40 numbers be generated, you can have 10 numbers of each letter within the group of 4 numbers
    * 10 numbers in position A 10 numbers in position B 10 NUMBERS c and 10 numbers in d
    * Example
    ** 1st group a b ab a .. 10 numbers a, a, a, ... 10 numbers in position a in the other group
    ********************* Cd d
    Only if possible ok

  7. #7
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Hello the macro has to scan all 45 groups, and choose only one numbers each group of 4 Which is in color

  8. #8
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    7,917

    Re: Generate random combinations only one number from each group of 4 letters

    I can see no 45 groups you refer to in your sample file.
    So nothing to scan.

  9. #9
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Kaper! think, each color has a group of 4 numbers, look calmly in the attachment
    ** But it has the colors each group color with 4 numbers, it's easy

  10. #10
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    01 15
    51 10
    06 47
    74 60
    08 58
    85 80
    03 38
    83 30
    07 69
    96 70
    04 18
    81 40
    35 59
    95 53
    24 68
    86 24
    02 89
    98 20
    26 49
    94 62
    13 29
    92 31
    09 45
    54 90
    23 48
    84 32
    05 37
    73 50
    17 46
    64 71
    12 39
    93 21
    67 28
    82 76
    14 78
    87 41
    16 34
    43 61
    26 79
    97 62
    56 27
    72 65
    19 26
    62 91
    36 57
    75 53
    52 25
    42 63
    #


    #
    Total de

  11. #11
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    01 15
    51 10

    06 47
    74 60

    ....45

  12. #12
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    7,917

    Re: Generate random combinations only one number from each group of 4 letters

    If you treat each color as a group, then there is only 24 of them

  13. #13
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Okay, there is yes it is 24 because then I saw that I put the second line
    * But the idea remains the same,
    * Then make lines of 20 numbers 5 each position
    * Can you? Make lines of 20?

  14. #14
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    13,903

    Re: Generate random combinations only one number from each group of 4 letters

    If I may interject, it is not clear to me what you are doing. If I understand correctly (even if I am uncertain in the details), I expect that the core of the algorithm will be INDEX() and RANDBETWEEN() functions (Function help files: INDEX() https://support.office.com/en-us/art...2-b56b061328bd
    RANDBETWEEN(): https://support.office.com/en-us/art...f-a469ab381685 ) Something like =INDEX($A$1:$B$2,RANDBETWEEN(1,2),RANDBETWEEN(1,2)) will randomly return one of the four values in that block of cells.

    Does that help get you started?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  15. #15
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Yes you can, expose your ideas, the forum allows, only the doubt has been clarified
    * That there are 24 groups of 4 numbers, mrshorty, difilmente in cad one groups are drawn 2.3 numbers, in 85% only a number of each group is why I need so now lines of 20 numbers for type keno 100-20, then the macro will pick up a number from each group of 4
    * And ride. Is easy

  16. #16
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Hello you can assemble on the Cartesian plane by crossing two groups of 4
    Ex =
    ******** 23 32 45 54
    15
    51
    04
    40

  17. #17
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    13,903

    Re: Generate random combinations only one number from each group of 4 letters

    I'm still not sure I understand. Why wouldn't =INDEX($A$1:$B$2,RANDBETWEEN(1,2),RANDBETWEEN(1,2) -- =INDEX($A$3:$B$4,RANDBETWEEN(1,2),RANDBETWEEN(1,2) -- =INDEX($A$5:$B$6,RANDBETWEEN(1,2),RANDBETWEEN(1,2) -- etc. work for you?

    If you must use VBA, the same thing could be done in VBA using the Cells() method and VBA's random number generating function.

  18. #18
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Okay then you can set groups of 4 rows and 4 columns
    * And do cartesian type, can you? I do not know anything about excel I'm a chauffeur driver

  19. #19
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    13,903

    Re: Generate random combinations only one number from each group of 4 letters

    Can I assume that you mean Cartesian Product (https://en.wikipedia.org/wiki/Cartesian_product ) here?

    In an arrangement like you show in post #16, I would probably simply use a suitable CONCATENATE() formula with the correct mix of relative and absolute references. Assuming the numbers in post 16 are in A2:A5 and B1:E1, perhaps something like =CONCATENATE($A2,B$1) in B2 and copied down and across. Note the mix of relative and absolute references. (Aside. You say that you don't know anything about Excel. Among the first lessons I ever learned about spreadsheets was how to mix relative and absolute references as described here: https://support.office.com/en-us/art...es_in_formulas )

    With data in other arrangements, I would still expect to use the INDEX() function or .Cells() method to access individual elements in each set/block/array, then combine elements as desired.

    If you need help understanding the .Cells() method: https://msdn.microsoft.com/en-us/VBA...e-object-excel

  20. #20
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    Yes, I'm going to need help,

  21. #21
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    7,917

    Re: Generate random combinations only one number from each group of 4 letters

    I've been trying to understand for already some time. And may be - I got it (or may be not )

    In columns FGHI expected result is that there shall be numbers from A1:B2, A3:B4, A5:B6 and A7:B8 in a way that one of them is from each corner of An:Bn+1 square.

    So with jorels nomenclature we shall randomly select numbers from each of 4 squares, but observing the rule that every one of them shall be from different position ABCD, ABDC, ACBD, ACDB etc.

    and the same for next for squares A9:B16, etc.

    As these data go down to B48 we will end up with 24 numbers in cells Fx:ACx.

    (still wondering where is
    we have 45 groups, you have to generate 40 numbers
    mentioned in post #5)

    The following code generates 1000 of such sets.

    Please Login or Register  to view this content.

  22. #22
    Forum Contributor
    Join Date
    11-29-2014
    Location
    brasil
    MS-Off Ver
    excel 2016
    Posts
    1,939

    Re: Generate random combinations only one number from each group of 4 letters

    ohh, kaper, perfect, work of, the best, thousand thanks,
    thank you, the blessed land of Pope Paul. Fight for hard work!

  23. #23
    Registered User
    Join Date
    08-18-2018
    Location
    boston ma
    MS-Off Ver
    version 1
    Posts
    1

    Re: Generate random combinations only one number from each group of 4 letters

    Hello Avid Keno Players, I only have one question.. How to get one number right in KENO massachusetts state lottery?

    I ask because you put down 20 dollars to win 50 dollars on a one spot.

    I have tried the forecast button in open office and sometimes this works, but not all the time.

    Can you explain to me how to use trend? Will it give me just one number?

    The computer also has a memory of what numbers are being played so you have to play on busy nights for it to be really random.

    I hope this information helps you and I hope you can help me in return. I am so frustrated over here.

    Thanks.

  24. #24
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often 365, but still time to time use also older versions
    Posts
    7,917

    Re: Generate random combinations only one number from each group of 4 letters

    Hi rehanavaidya.

    Welcome to the forum.

    Please note that it's excel forum, not keno forum

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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] Generate random formations, but without repeating the letters in the columns and in the ro
    By jorel in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 04-13-2017, 01:15 PM
  2. Automatically generate random letters after typing
    By Bjorn Smeets in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-10-2016, 07:35 AM
  3. Generate all possible combinations between 3 letters
    By rcprito in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-18-2015, 05:47 PM
  4. Generate random Alphanumeric with two letters and three numbers
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-25-2015, 09:19 PM
  5. Replies: 5
    Last Post: 06-21-2013, 10:40 AM
  6. Function to Generate Random Numbers and Letters
    By jason_kelly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-14-2010, 03:39 PM
  7. List all the combinations of a group of cells containing letters, but not numbers
    By tanaka1986 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 02-12-2008, 06:38 AM

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