for 2003
=SUMPRODUCT(--($A$2:$A$500="samedata"), --($B$2:$B$500="samedata2"), $C$2:$C$500)
adjust ranges as needed (all must be the same length)