Countif Help

  • Thread starter Thread starter rttg
  • Start date Start date
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.
 
if a cell contains:
333
and the following cell contains:
1

Should it be counted three times, or one time, or not at all??
 
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.
 
in B1 enter:

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

In C1 enter:

=SUM(B:B)
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top