I've been trying now for quite some time and am so close to fixing this but just can't get it work.
I got an Excel file where we do our local lottery, so sheet one is everybody their name and chosen numbers, and another sheet is the draws.
Now I'm trying to create a cell to see how many numbers each person got right according to the numbers drawn. I've partly done it with SUMPRODUCT(COUNTIF
, but if a number is drawn twice, it will also be included twice in the total.
As you can see there is a number 11
, which should be the total count of green cells (matches). Which is now incorrect, since there are for the first row just 7
green cells and not 11
.
Therefore I need some help with my formula there to extract only the unique values. My formula now is:
=SUMPRODUCT(COUNTIF(B2:K2,Draws!$B$2:$G$18))
The formula should be (in Excel 365)
=SUM(--(COUNTIF(Draws!$B$2:$G$18,B2:K2)>0))
so it only counts matches in the Draws sheet once
or
=SUMPRODUCT(--(COUNTIF(Draws!$B$2:$G$18,B2:K2)>0))
in earlier versions of Excel
The Draws sheet looks something like this: