COUNTIF With two criteria

B

Boran Düzgün

How can i count rows with two criteria. I can use COUNTIF with only one
criteria... does it posible to count with two criteria..

For example, I need to count the A's in the column A1:A100 which satisfies
the condition "O" in column D1:D100.
 
B

Bob Phillips

=SUMPRODUCT(--(A1:A100="A"),--(D1:D100="O"))


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
S

Sandy Mann

Try:

=SUMPRODUCT((A1:A100="A")*(D1:D100="O"))

--
HTH

Sandy
(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 
Joined
Mar 4, 2006
Messages
2
Reaction score
0
countif

if you do not insist on "countif" here is something to consider

Sub countCells()
Dim x As Variant
Range("your choice", Range("your choice").End(xlUp)).Select
For x = 5 To Selection.Rows.Count - 1

If ActiveCell.Value > your choice Or ActiveCell.Value < your choice or other choice Then
Range(your choice).Value = Range(your choice).Value + 1
End If
Next x
End Sub
 

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

Similar Threads

Countif, index and match 2
Excel Need Countifs Formula Help 0
Access Dcount (multiple criteria) 3
countif 4
Countif time syntax 6
COUNTIFS with No Criteria 1
countif using cell references in criteria 2
COUNTIF Function 5

Top