Collecting lottery data and need to count how many times a pair of numbers shows up

TheseStars

New Member
Joined
Mar 17, 2016
Messages
10
Greetings!;)

New forum member here and a novice at best at Excel. Could use some help, not able to solve my problem on my own.

---I'm struggling at the moment trying to find the correct formula that will count how many times a pair of numbers are showing up together.

I'm using MS Office 2016 Excel and tracking my states pick 3 lottery results.

I want to count how many times the 2 is showing up with the 0 across a 30 or 31 day period. I want to do this for all 45 pairs.

Columns x, y and z are holding the draw results for the 1st, 2nd, and 3rd position of the results, so my range is of course 30 or 31 sets (depending on month) of 3 digit numbers each in their own cell.

any help would be appreciated, I tried everything I think I knew, but not having any luck.

Thanks!
 
In column K4, I entered this formula as you gave it me changing only the cell ranges. {=SUM(--(MMULT(($U$6:$W$36=I3)+($U$6:$W$36=J3),{1;1;1})=2))}

You'll get funny results if your formulae point to the previous row! :)

But there is a bigger problem. I see from your screenshot that the lottery results can be duplicated, e.g. a possible draw would be 9|9|9, which I haven't allowed for.

Here's a quick fix. The formula is not particularly elegant, but I can't immediately come up with anything more succinct.

G2: =SUMPRODUCT((MMULT(--($A$3:$C$10=E2),{1;1;1})>=COUNTIF(E2:F2,E2))*(MMULT(--($A$3:$C$10=F2),{1;1;1})>=COUNTIF(E2:F2,F2))) (No need to array-enter this time)

ABCDEFG
1LOTTERYYour pairs# times
2No #1No #2No #3114
3111196
4119994
5191
6199
7911
8919
9991
10999

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>

 
Upvote 0

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Thanks Stephen,

I will go this new one a go in the am! Stay tuned.

Funny how the word elegant has a whole new meaning.

Cheers,
 
Upvote 0
Hey Stephen,

Looks like I'm still having some trouble, here's a cut and paste of the formula with the row and column headings,

I started to do did a rough count of the pairs running down in Column G just so I could see if I was getting close to victory testing what you give me.

K3 shows what I entered. I can't figure out what I'm doing wrong.

Too many 0's are showing up when the return should be at least 1 or greater. (my rough count is not complete nor accurate).



7430260_orig.png
 
Upvote 0
It works for me:

K3: =SUMPRODUCT((MMULT(--($U$6:$W$36=I3),{1;1;1})>=COUNTIF(I3:J3,I3))*(MMULT(--($U$6:$W$36=J3),{1;1;1})>=COUNTIF(I3:J3,J3)))

Do you have Calculation set to manual, or circular references?

IJKLMNOPQRSTUVW
2PairCount
3021
4042Lottery
5593
6773594
7163
8414
9925
10299
11521
12707
13439
14662
15314
16724
17597
18977
19640
20405
21600
22899
23614
24280
25443
26158
27780
28888
29294
30018
31777
32870
33125
34556
35631
36994

<tbody>
</tbody>
 
Upvote 0
Thanks again, I'm going to try to move to another cell.

Not getting a circular reference message, or a error.

I just changed my my calculations set to Automatic.

Still didn't work. Going to try something. Will get back to you.

Thanks again. Really appreciate all your help.
 
Upvote 0
If you're still stuck, and happy to post your workbook (or a cut-down version) you can always upload to a provider like box.com and post the link here.
 
Upvote 0
Your numbers in I:J are formatted as text. Change to numeric and the formula appears to work OK.
 
Upvote 0

Forum statistics

Threads
1,216,905
Messages
6,133,392
Members
449,806
Latest member
nmusoke17

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