How about a pivot table?
If not
2007 =COUNTIFS($A$1:$A$6,1,$B$1:$B$6,"Dave")
Pre-2007 =SUMPRODUCT(--($A$1:$A$6=1),--($B$1:$B$6="Dave"))
Instead of hard coding you could also point to a cell.
=COUNTIFS($A$1:$A$6,G1,$B$1:$B$6,H1)
=SUMPRODUCT(--($A$1:$A$6=G1),--($B$1:$B$6=H1))