counting cell between a number

Hello everybody.
In the lotto wining history list, somebody have a vba code to count the skip values between the numbers.
I am talking about to know for example number 1 what distance is the next, or skip and the same with the rest. in fantasy 5 for example/
 

Icewynd

Member
Are you talking about a skip & hit chart? I just use the following formula in Excel:

=IF(COUNTIF($B6:$H6,J$4),0,J5+1)

The page is set up as follows:

Column A: draw date
Columns B-G: 6 drawn numbers (this is for a 6/49 lotto)
Column H: Bonus number
Columns J-BF: Numbers 1-49 in row 4 -- copy the above formula into cells J6:BF6 and copy down.

So the formula looks up the number 1-49 in row 4, sees if it is among the drawn numbers and if it is puts a zero in the cell. If the number is not found in the drawn numbers it adds "1" to the result in the previous cell, so that you have a count of how many draws have been skipped since the last hit for that number.

Hope this is what you were looking for.
 

Sidebar

Top