Countif Help

R

rttg

I have a column that has a series of numbers and I want to count the number
of 3’s and the following number = 1.
 
G

Gary''s Student

if a cell contains:
333
and the following cell contains:
1

Should it be counted three times, or one time, or not at all??
 
R

rttg

Col A
--------
1
2
3
4
1
2
1
2
3
1
2
3
4

In this case the count would be 1. The values would on be 1, 2, 3, or 4 and
I only want to count if the value following 3 equals 1.
 
G

Gary''s Student

in B1 enter:

=IF(AND(A1=3,A2=1),1,"") and copy down

In C1 enter:

=SUM(B:B)
 
R

Rick Rothstein \(MVP - VB\)

Give this a try...

=SUMPRODUCT((A1:A99=3)*(A2:A100=1))

Note that when expanding or contracting the above ranges, the maximum row in
the left hand expression must be one less than the maximum row in the right
hand expression (hence, the A99 and A100 being different by 1).

Rick
 
Top