Question : Excel Count w/ Multiple Criteria on another Sheet

I have two sheets in a workbook (Excel 2003).

Sheet1:
            A1            A2
A1      Matt         FALSE
A2      Matt          TRUE
A3      Matt          TRUE
A4      Chris       FALSE
A5      Chris        TRUE
A6      Tom          TRUE
A7      Tom         FALSE
A8      Tom          TRUE

Sheet2 (this is what it should ultimately look like):
            A1            A2
A1      Matt             2
A2      Chris           1
A3      Tom             2

What I need to do is count the number of TRUE values in Sheet1 where the names match. I am having trouble doing this.

Some formulas I have tried in cell A1 of Sheet2 look like this:

=SUM(IF(Sheet1!A:A=A1,IF(Sheet1!B:B = "TRUE",1,0)))
=COUNT(IF(Sheet1!A:A=A1,IF(Sheet1!B:B="TRUE",COUNT(Sheet1!B:B),0),0))

But these don't work.

Any ideas?

Answer : Excel Count w/ Multiple Criteria on another Sheet

Try this Macro:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
Sub counter()
Dim num As Long, val As String, rng As Range
 
For Each cell In Sheets(2).Range("a1:a50")
If cell.Value <> "" Then
num = 0
val = cell.Text
 
For Each rng In Sheets(1).Range("a1:a50")
If rng.Value = val And rng.Offset(0, 1).Value = True Then
num = num + 1
End If
Next rng
cell.Offset(0, 1).Value = num
End If
Next cell
End Sub
Random Solutions  
 
programming4us programming4us