You're looking for a SUMIF formula. Ex:

=SUMIF(B2:B10,"Tests",C2:C10)