Any Excel VBA or Excel functions that can help with general lottery forecasting?

angExcelentflea

New Member
Joined
Aug 6, 2019
Messages
4
Permission to post, admins...

Mostly the posts here about the lottery concern with random number generation, with pick-3 games and with lotteries dealing with huge numbers (e.g. 5 out of 90). I am only concerned with general, simple lottery forecasting concerns.

So, I'm wondering if anyone here knows some VBA formulas for the following tasks:
a) Counting the frequency of each number in a lottery game

b) Determine which are "hot" numbers, "cold" numbers and "overdue" numbers within a certain draw period in a lottery game

c) Know how many times a number is paired with another number

Hope you would consider helping me out in this...
 
Just a "random" observation (wink).... Be careful with your interpretation of the overall frequency table. That lottery changed from 1-to-49 to 1-to-59 in Oct 2015. That is why the frequency of 50-to-59 is so far out of line, not some inexplicable bias in the selection process.
Very good point!
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
It's been a while since this was first posted but I thought I'd share my opinion anyway.

Not sure how easy would be to achieve this with Excel but I have some ideas that may help. Most lottery related Excel sheets I came across would have the lottery results in a number of columns equal to the total numbers drawn. The problem with such layout is that, in order to achieve what you want, it may complicate things due to the complexity of the formulas needed.

Let's say you want to do your forecasting for a 5/45 system. If you have your drawn numbers in five columns, the rows in your Excel sheet will look similar to the following:

12
15​
19​
26​
31​
4​
5​
9​
12
22​
5​
8​
12
15​
19​

Notice how number 12 is in the first column of the first row but, in the second row is in column four while in the third row, the same number 12 is in the third column. What this means is that, for each number in every row, you will have to iterate trough all other rows and, inside each row iteration, you'll have to iterate trough all five columns to see if there are any matches.
With a large set of lottery numbers, this may take some computing power, especially if you will want to do some additional calculations. I'm thinking about how many times a number is paired with another...

So, maybe a 45 column layout would be a better idea. 45 columns which would hold any drawn number from 1 to 45, or cell left empty for the not drawn numbers. In this case, for the first set of numbers (the ones in the first row in the above table) you'd have empty cells from A to J, then column K would contain number 12. Columns M and N empty, and 15 would be in column O. And so on and so forth... Hope this makes sense...
Such layout (as many cols as numbers in the pool) would probably be a better optimized solution for your task because in this way you would have to iterate, for each number, trough its own column only, and not worry about the other columns. At least to find the number frequency and the "hot", "cold" and "overdue" numbers.

The hot numbers would simply be those that have been drawn the most (is present in most cells in the column that holds that particular number) during a given period which you can define yourself (e.g. from row nr. X to row nr. Y)
And in a similar way, the cold numbers would be those drawn the least during a given period.
The most overdue numbers would be those that have the most empty cells above or under them, depending how you'll be sorting/inserting the numbers in your spreadsheet, top/bottom or bottom/top.

For the number pairs, things are a little more complicated because you'll most likely need to iterate -- for each of the 45 numbers -- trough each row and find out what are the other numbers that came out with the number you're looking at. And if you're looking for more than simple, two number pairs, it may be really difficult. But I am not really an Excel expert so don't know if Excel has any built in functions that could help you with that.

Now, back to what you are trying to achieve, as explained in the initial post...

I have been working on a web-based lottery prediction system for more than five years now (full time) and I can say that, to get, even a tiny-TINY bit, closer to the winning results of any lottery, you will need a whole lot more than those three points (a, b and c)

So, assuming the goal is to somehow narrow down the possible outcome, based on my experience I can say that:

1. Point a) is not going to help at all
2. Point b) may be somewhat useful in further, more complex tasks (e.g. wheeling trough all possible combinations and only considering some that meet certain criteria)
3. Point c) is again, not useful

If anyone is interested, I can explain the above 3 statements in detail.
 
Upvote 0
I have been working on a web-based lottery prediction system for more than five years now (full time) and I can say that, to get, even a tiny-TINY bit, closer to the winning results of any lottery, you will need a whole lot more than those three points (a, b and c)
I'm afraid, LottoMatic, that you are doomed to failure. The lottery is random, and so complex algorithms, trend analysis, etc. will be no better than selecting numbers at random. The only possibility of 'improvement' on random selection would be if the balls themselves had some physical variances (e.g. slightly lighter weight, rougher surface, etc.) so that they may be infinitesimally more or less likely to emerge - I remember some speculation when the UK lottery first started that the numbers printed on may affect the weight of each ball, but that was disproved very quickly.
 
Upvote 0
jmacleary, my statements are based on real data, on five years of studying, comprehensively, about 100 lotteries across the world.

Would you mind sharing what are your statements based on? Please don't get me wrong, I'm not being disrespectful.
I just keep reading statements like yours all over the internet. And that's just fine but I'd really like to hear what are those statements based on.

And the only reason I'm asking is because my work shows the opposite.
 
Upvote 0
Hi there. It is based on my maths knowledge (grade A A level), and material I have read (like you) on the internet. Coincidentally, this year's Christmas Lecture series from the Royal Institution by Dr. Hannah Fry covers why there will always be some small variances to 'flatlining' (the theory that, over a large enough sample set, all numbers will emerge the same number of times - but they don't).

If you plot the number of times each number has come up in the lottery (after the increase in numbers or for any other world lottery that has a fixed set of numbers) you will end up with a normal distribution graph. As the number of draws continues, the graph will continue to be a normal distribution shape, with some numbers coming out more often than others, but still within the bounds of a normal distribution, so I would suggest that any lack of randomness you perceive in your data may well be within the bounds of statistical randomness. That however is as far as my knowledge goes, and I will bow to your more comprehensive knowledge of the data.

I think maybe, that a slight edge in terms of amount worn can be obtained by avoiding combinations that are most popular with other players - apparently many people choose 1,2,3,4,5,6 - if that comes out there will be a very small payout per person. So, taking that idea forward, maybe analysing the number combinations used when there were low payouts, and avoiding those, might produce a higher return IF your chosen numbers appeared.

Good luck with finding an edge.
 
Upvote 0
Not sure how easy would be to achieve this with Excel
Not sure ("why") do you study programming?
trends:
just for fun look at it
1665901242177.png

all the six trend lines 😂 but is a picture and it is incomplete
 
Upvote 0

Forum statistics

Threads
1,224,742
Messages
6,180,684
Members
452,993
Latest member
FDARYABEE

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top