Lottery Checker counts drawn numbers more then once.

angusn

New Member
Joined
Jan 20, 2011
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Hi. I'm using Excel 2010 on an XP machine.

What I have setup is a grid (C5:H325) where everyone enters lottery numbers of their choice, between 1 and 49, and in another grid (E333:K352) is where the drawn numbers are entered.

I then have off to the side in columns N325 through S325 is "=COUNTIF(winningnumbers,C325)" with the column letter changing as necessary.

What's happening is when I enter drawn numbers in the (E333:K352) grid the countif will count the number if it appears and place the total count in cell M325.

What it is not supposed to be doing and what I'm hoping for a solution for is that the countif stops counting after it has counted the number once. For it not to count duplicates. So if a number shows up 5 times from 5 draws, it's only counted once. See the number 50 & 52 below.

I've searched on this form and found many lottery forms but none that have my dilemma. Searching Google, the only thing that I could find that sounded like it might help was from the website Count Repeated Items Once. Count One Occurrence Formula but I just couldn't seem to get it to go.

Any help would be appreciated. Thank You.


TmiSUSk.jpg
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hi angusn,

I found this, which may do what you want. Range adjusted of course, if not correct here.

=SUM(IF(FREQUENCY(E3:J3,E3:J3)>0,1))

=SUM(IF(FREQUENCY(E3:J7,E3:J7)>0,1))

Howard
 
Last edited:
Upvote 0
This seems to do the same, be careful with any text entries.

=SUMPRODUCT(1/COUNTIF(E3:J7,E3:J7))

Howard
 
Upvote 0
Thanks for the suggestions Howard. I put them in but didn't see them doing what I wanted. After a couple nights sleep and a venifer infusion I believe I was thinking a little more clearly. What I did was in the cells of column M i put the following... =COUNTIF(N5:S5,"<>0")

This allows me to count the cells that contain a number, regardless of the value, and ignore any zeros.

The final product that looks like it works now.

vtQ5Gzf.jpg
 
Upvote 0

Forum statistics

Threads
1,226,027
Messages
6,188,477
Members
453,477
Latest member
jomowens

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