SUMIF
Math

Adds the cells specified by a given criteria

Syntax:

=SUMIF(range, criteria, [sum_range])

Example:

=SUMIF(A1:A10, ">5", B1:B10)