+ Reply to Thread
Results 1 to 15 of 15

lottery

  1. #1
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    lottery

    Hi, i know by the formula =combin(49,6) how many combination of 6 numbers there are from a available 49 numbers (13983816).

    how do i manage to get all combinations listed in a excel spreadsheet? I would want the numbers in individual cells. For example, Row 1 would show 6 numbers individually from A1 - F1.

    I do realise that excel does not have enough rows to do this so may have to continue on other sheets.

    As you may have guessed i am doing something on the lottery numbers and also would want it to generate a bonus number in column G.

    Formulas in excel as oppose to excel VB code is preferred.

    Many thanks.

  2. #2
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    Re: lottery

    From the lack of responces and from noticing the lack of respones in other similar request threads - im kinda thinking it is really hard to do or nobody knows how.

    I appreciate a lot of storgae would be required for something like this. To use as less sheets as possible, additional columns on the same sheet could be used eg; a-g and then I-O.

    I wait and hope for a solution.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: lottery

    Hi,

    What is it exactly that you want to 'do'. It may be possible to do without resorting to listing every single combination.

    Rgds
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: lottery

    Good afternoon heramiah

    I don't think Excel is the right application to do this in. Being limited to 65k rows (in Excel 2003 - you don't state which version you're working in) will result in over 200 sheets and is going to be extremely unwieldy and will result in you making more posts to keep this file updated, response times will be slow, massive files will be the order of the day : I don't know exactly what you want to achieve, but there have to be better ways of doing this than using Excel.

    try googling for lottery software - I've had a quick search and there seems to be plenty of options.

    Oh, and FWIW you couldn''t do this type of thing without VBA, and it would be a pain to write and take an absolute age to run (probably longer than it took to write, TBH).

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  5. #5
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    Re: lottery

    Thanks for your responses!!

    I'm ok with Excel and i do realise this is a bit of a brain stormer - for me anyway!

    File size is not an issue and i do realise that there would be plenty of sheets required. Im using excel 2003 by the way.

    The reason i need to do this in excel is because i wish to then be able to manipulate and analyse the results and so cannot use a ready made app like those found on the internet.

    Ultimately, it does not matter if this is acheived via VBA code or formulas.

    Sorry guys, i still want these combinations as ive actually thought about doing this for a veeeery long time. Unfortunately, im not that confident in VBA.

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: lottery

    well with just 6 columns 65536 rows the file is about 4 meg per sheet so i dont really see a 950+ meg file being any good! besides which to use functions to do the calculation would just not work.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: lottery

    Quote Originally Posted by heramiah View Post
    Thanks for your responses!!

    The reason i need to do this in excel is because i wish to then be able to manipulate and analyse the results......
    Hi,

    If what you say above is literally correct and all you're trying to do is analyse the results each week, why do you need to list every single combination? How does that help in analysing the actual results - (leaving aside the implied suggestion that there is perhaps some causal relationship between all the results, there isn't)?

    Why not just list the weekly results and analyse them?

    Rgds

  8. #8
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    Re: lottery

    Columns A-G, I-N, Q-V, Y-AD, AG-AL, AO-AT, AW-BB. If filled down to 65536th row = a 21.7meg file.

    65536 rows * 7 column sets = 458752 different combinations in a sheet.
    combin(49,6) = 13983816
    13983816 / 458752 = 30 sheets required!!

    I think thats possible. Each sheet will obviously be a fraction larger when adding a bonus number and after incorporating the analysis i would do later.

    Come on guys, let me worry about the size and number of sheets required issue. I just need to solution or even a hint so i can make a start.

  9. #9
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    Re: lottery

    RICHARD:
    I'm not wanting to analyse each weeks results, but wanting to analyse and look into ALL the combinations. I have some querys and with which i wish to interrogate each combination. This is nothing to do with real weekly results.

  10. #10
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    Re: lottery

    OR, Lets make it easy for now:

    how would i do the same for a lesser amount of numbers. Lets say i want all combinations out from 1-10. I still want 6 numbers selected and a seperate bonus number from 1-10.

    Any ideas?

  11. #11
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    Re: lottery

    BY THE WAY,
    from the comments above, i think you guys think im wanting this all on 1 .xls file. It could all be spread across many files and not all on many sheets in 1 file; which would be silly!

    when running the formula/VBA code in a new .xls file, it would need to be aware that it is continuing from another file. not sure how this could be done as otherwise the code would start from scratch in each new file. maybe if in the new file the first combination could be manually inputted which would be the same as the last combintaion in the previous file and so it would continue off that?

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: lottery

    1-10 is easier as there are only 210 combinations or 2100 with a bonus ball
    i use this quite often you dont have to use letters single digit numbers will also work
    (or you can use letters then find replace later with numbers)
    http://www.ne.jp/asahi/math.edu/ami/myprog/jk_eng.htm
    Last edited by martindwilson; 02-16-2010 at 12:42 PM.

  13. #13
    Registered User
    Join Date
    07-31-2007
    Location
    Newcastle Upon Tyne, UK
    MS-Off Ver
    2003
    Posts
    20

    Re: lottery

    martindwilson: its not the extact answer i was looking for, but thanks anyway! the link you provided does give a interesting tool.

    thanks

  14. #14
    Valued Forum Contributor mdbct's Avatar
    Join Date
    11-11-2005
    Location
    CT
    MS-Off Ver
    2003 & 2007
    Posts
    848

    Re: lottery

    The following will ask for the upper number for the combinations. It will then populate the sheet with the possible combinations, entering one possibility per cell. It enters the combinations as such 01,02, 03, 04, 05, 06. It will fill down to row 65,000 before moving to the next column.

    I added a basic timer that will display the number of seconds it took to run the macro.


    Please Login or Register  to view this content.
    It took a little over 4 minutes to all combinations for max number of 40.

  15. #15
    Registered User
    Join Date
    02-23-2010
    Location
    canada
    MS-Off Ver
    Excel 2003
    Posts
    1

    hi

    thanks anyway! the link you provided does give a interesting tool.


    Free maplestory nx

+ 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