Excel Countif

  • Thread starter Thread starter Gary Hunt
  • Start date Start date
G

Gary Hunt

I am trying to write a lottery databse spreadsheet, but I
cannot get the last tab to work correctly.

What I want to do is count how many times a pair (2)
Numbers occur in all of the previous lottery draws.

See example below

=COUNTIF('Draw Data'!C2:I1001,"1,2")

It works fine when only asking for 1 number, but not 2

see below

=COUNTIF('Draw Data'!C2:I1001,"1")
 
I don't think I understand what you are trying to accomplish. What do the
rows and columns represent? How is the data organized?
 
Try either of these:

=COUNTIF(C:I1001,2)+COUNTIF(C2:I1001,1)

=SUMPRODUCT((C2:I1001=1)+(C2:I1001=2))

These will work for numbers.
Don't know why you're using parenthesis for your examples
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



I am trying to write a lottery databse spreadsheet, but I
cannot get the last tab to work correctly.

What I want to do is count how many times a pair (2)
Numbers occur in all of the previous lottery draws.

See example below

=COUNTIF('Draw Data'!C2:I1001,"1,2")

It works fine when only asking for 1 number, but not 2

see below

=COUNTIF('Draw Data'!C2:I1001,"1")
 
I didn't mean parenthesis, I meant quotes ("1").

Since you said "it" (your formula with quotes) works, perhaps you're
importing data, and the apparent numbers in reality are text.

If that's the case, just enclose the numbers in my suggestions with quotes.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

Try either of these:

=COUNTIF(C:I1001,2)+COUNTIF(C2:I1001,1)

=SUMPRODUCT((C2:I1001=1)+(C2:I1001=2))

These will work for numbers.
Don't know why you're using parenthesis for your examples
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================



I am trying to write a lottery databse spreadsheet, but I
cannot get the last tab to work correctly.

What I want to do is count how many times a pair (2)
Numbers occur in all of the previous lottery draws.

See example below

=COUNTIF('Draw Data'!C2:I1001,"1,2")

It works fine when only asking for 1 number, but not 2

see below

=COUNTIF('Draw Data'!C2:I1001,"1")
 
Back
Top