# Sum Range Combinations

#### Sandman

##### Member
Hello folks, been a long while. 1st new addition to the family has consumed me for the last few months & loving every second of it.

I have a question re: Sum Range Combinations

If I wanted to view every 6 number combination that adds up to the sum range of 150 ( 165,772 of them ) , what program could perform this enormous task?? Could Excel help out (doubtful).
I would like to be able to filter out combinations that i would eliminate such as tickets with numbers in them like 23,24,25,26
ect... I'm just wondering how much filtering one could perform with any given sum range? I know it would still be an enormous amount of combos left even after filtering, but i sure would like to view these combo's on my own. Then obviously be able to view other sum range combo's in the same manner.

I hope this is even worth answering to somebody.

#### doc

##### Member
Sandman said:
Hello folks, been a long while. 1st new addition to the family has consumed me for the last few months & loving every second of it.

I have a question re: Sum Range Combinations

If I wanted to view every 6 number combination that adds up to the sum range of 150 ( 165,772 of them ) , what program could perform this enormous task?? Could Excel help out (doubtful).
I would like to be able to filter out combinations that i would eliminate such as tickets with numbers in them like 23,24,25,26
ect... I'm just wondering how much filtering one could perform with any given sum range? I know it would still be an enormous amount of combos left even after filtering, but i sure would like to view these combo's on my own. Then obviously be able to view other sum range combo's in the same manner.

I hope this is even worth answering to somebody.

Well,---first of all, congratulations on the new addition to the family. There is no more magical time that you will ever experience. Enjoy and cherish this time in your life. It will never come in quite the same way again.

Other than those two programs, I really don't have much from my experience (as a lottery software junkie) to recommend. Hope you find this helpful.

#### GillesD

##### Member
TO: Sandman

You are right one out of two.

There are 165,772 combinations that add up to 150 but it can easily be done in Excel.

The following program in VBA will list your 165,772 combinations fairly quickly (depending on your computer).

Option Explicit

Dim A As Integer, B As Integer, C As Integer
Dim D As Integer, E As Integer, F As Integer
Dim N As Long

Sub List_Comb()
Range("A1").Select
Application.ScreenUpdating = False
N = 0
For A = 1 To 44
For B = A + 1 To 45
For C = B + 1 To 46
For D = C + 1 To 47
For E = D + 1 To 48
For F = E + 1 To 49
If A + B + C + D + E + F = 150 Then
ActiveCell.Value = A & "-" & B & "-" & C & "-" & D & "-" & E & "-" & F
ActiveCell.Offset(1, 0).Select
N = N + 1
If N = 65001 Then
N = 0
ActiveCell.Offset(-65001, 1).Select
Application.ScreenUpdating = True
Application.ScreenUpdating = False
End If
End If
Next F
Next E
Next D
Next C
Next B
Next A
Application.ScreenUpdating = True
End Sub

TO: Doc

Yes you can buy many programs that may do you want but why waste money when you most likely already have all the tools in your computer: Excel. I have not found many calculations in a lottery that could not be obtained in Excel.

#### doc

##### Member
GillesD said:
TO: Sandman

You are right one out of two.

There are 165,772 combinations that add up to 150 but it can easily be done in Excel.

The following program in VBA will list your 165,772 combinations fairly quickly (depending on your computer).

Option Explicit

Dim A As Integer, B As Integer, C As Integer
Dim D As Integer, E As Integer, F As Integer
Dim N As Long

Sub List_Comb()
Range("A1").Select
Application.ScreenUpdating = False
N = 0
For A = 1 To 44
For B = A + 1 To 45
For C = B + 1 To 46
For D = C + 1 To 47
For E = D + 1 To 48
For F = E + 1 To 49
If A + B + C + D + E + F = 150 Then
ActiveCell.Value = A & "-" & B & "-" & C & "-" & D & "-" & E & "-" & F
ActiveCell.Offset(1, 0).Select
N = N + 1
If N = 65001 Then
N = 0
ActiveCell.Offset(-65001, 1).Select
Application.ScreenUpdating = True
Application.ScreenUpdating = False
End If
End If
Next F
Next E
Next D
Next C
Next B
Next A
Application.ScreenUpdating = True
End Sub

TO: Doc

Yes you can buy many programs that may do you want but why waste money when you most likely already have all the tools in your computer: Excel. I have not found many calculations in a lottery that could not be obtained in Excel.

Maybe so---but not everyone either has Excel or has the time to learn how to use it properly or has the smarts to use it at all. Try to remember that not everyone is a computer genius. That is why we all pay programmers to do the hard work for us. Could you have programmed the Excel application by yourself? I doubt it. You obviously benefit from its use whether you paid for it or not. Live and let live Bud. Everyone needs a helping hand at some point---and in today's world, it usually doesn't come without having to pay the freight.

#### Sandman

##### Member
Thanx Big G, Just what I needed to know. I love using excell & am getting better at using it all the time. What you showed me is a little complex for me at the moment, but can easily feed from it. I may not be a math wiz, but I do love numbers
Could you show me an actual excell spreadsheet as an example for the sum range of 150 unless it's too much work to ask for such a task? I learn best by visualization. If not, no problem.
Thanx for your response. That goes for you as well Doc

#### GillesD

##### Member
Combinations

To: Doc

Thanks for your nice comment on my knowledge of Excel: "Could you have programmed the Excel application by yourself? I doubt it. " Stick around for a few months or go see my previous postings and you will learn a few things.

The problem with me is that I do not believe in lotteries (I bet one quick pick per draw) but I love playing with numbers. And playing with numbers from Lotto 6/49 has allowed me to improve (but not master yet) my knowledge of Excel. Since I do use it on a regular basis in my work, the benefits I got have far exceeded whatever time I spent learning it and providing information here. If you want to see a master at work, look at N.K.'s postings.

To: Sandman

"too much work to ask for such a task?", certainly not but you can do it yourself.

1 - Open a worksheet and then a module in VBA (Alt-F11)
2 - Cut and paste the program I posted into that module
3 - Go back to the worksheet and start the program List_Comb
4 - Wait a few minutes (less than 2 on mine) and you will get all 165,772 combinations in columns A, B and C.

Easy to do and you can adapt the program to list combinations meeting whatever conditions you want by changing the condition (in this case, "A + B + C + D + E + F = 150") to whatever you need.

#### doc

##### Member
Re: Combinations

GillesD said:
To: Doc

Thanks for your nice comment on my knowledge of Excel: "Could you have programmed the Excel application by yourself? I doubt it. " Stick around for a few months or go see my previous postings and you will learn a few things.

The problem with me is that I do not believe in lotteries (I bet one quick pick per draw) but I love playing with numbers. And playing with numbers from Lotto 6/49 has allowed me to improve (but not master yet) my knowledge of Excel. Since I do use it on a regular basis in my work, the benefits I got have far exceeded whatever time I spent learning it and providing information here. If you want to see a master at work, look at N.K.'s postings.

To: Sandman

"too much work to ask for such a task?", certainly not but you can do it yourself.

1 - Open a worksheet and then a module in VBA (Alt-F11)
2 - Cut and paste the program I posted into that module
3 - Go back to the worksheet and start the program List_Comb
4 - Wait a few minutes (less than 2 on mine) and you will get all 165,772 combinations in columns A, B and C.

Easy to do and you can adapt the program to list combinations meeting whatever conditions you want by changing the condition (in this case, "A + B + C + D + E + F = 150") to whatever you need.

GillesD:

My comment about programming the Excel application was probably worded awkwardly. I didn't mean the VBA macros that you program within Excel. I meant the actual Excel program itself, or any other spreadsheet program. You are obviously very skilled at using the power within Excel and I apologize if you were insulted by my easily misunderstood comment.

#### Sandman

##### Member
Thank you ever so much Gilles, I really appreciate your quick responses with exactly what I was looking for. You the Man!!!

#### peter

##### Member
Having read the above posts from both Gilles and Doc, the observation, I make is that both of you make valid points.
Doc, states, not everyone has excel, and not everyone knows how to use all of the functions, therefore software that allows you to do a certain function would be the way to go.
Gilles states that Excel contains many features that one could want, so why buy software, this to is a good point, if you have the time and brains to learn Excel and its many features.
My conclusion gentleman, is this, I'm glad that we have two experts on board that can help us computer handicapped, so that we may be able to enjoy the lotto with abit more pleasure. There is no sarcasm intended here, and I look forward to future posts from all of the pros here,and there are many.

#### Sandman

##### Member
Hey GillesD, I was a big fan of Excell before, but WOW....., Thanx to you my eyes are really open to the program now. I was doing simple charts with it before, I love the complexity & power you've shown me Excell is really capeable of.
I'm trying to focus on the "Bell Curve" theory with Sum ranges between 115 & 185 for any 649 lotto & my computer will give me all the combinations for each of these sum ranges in a couple of minutes. Again thanx and if there are any other quick Excell tips from the Big G Man, I would gladly listen.

P.S The copy & paste formula you sent me worked absolutely perfect!!!

#### higgy

##### Member
There are a couple of free spreadsheet programs out there to be had
http://www.openoffice.org/
for one......albeit you still have to learn how to use them

#### GillesD

##### Member
Normal distribution

Sandman said:
... I'm trying to focus on the "Bell Curve" theory ...

You might be interested in using the NORMDIST function to determine normal distribution for a given mean and standard deviation.

I have used it to generate expected distribution for the average of the 6 winning numbers. I then made a bar chart with individual frequencies for averages and I added a line chart with the calculated normal distribution frequencies.

This allows to quickly visualize how actual data compares to the normal distribution for your data.

#### heminen

##### Member
Hello

i have a registered version of Expert lotto.
it's take me 10 seconds to have the 165772 tickets with a sum of 150 in my package.

Read the order / free section, you can have it free if you make some work...

in this soft,you have a lot of filters to customise yours plays
Very powerfull

see also the forum <<< links to other forums violate the membership agreement >>> if you are registerd you have two additionnal sections, jackpot and plug in development

Cordialement

Last edited by a moderator:

#### tomtom

##### Member
A questin

higgy said:
There are a couple of free spreadsheet programs out there to be had
http://www.openoffice.org/
for one......albeit you still have to learn how to use them

If search , there is also a thread about open office and some other free and good programs for calculations at this forum