=SUMIF([range],criteria,[sum_range])
=SUMIF(A1:A10,">5")
The example returns the sum of all the cells in the range A1:A10 that are greater than 5. This is a simple example of the SUMIF function that takes a range of cells and a condition (in this case, all cells greater than 5).
=SUMIF(B1:B10,"red",A1:A10)
The example returns the sum of the cells in range A1:A10 when the cells in range B1:B10 match the color "red". This example makes use of two ranges, one for the condition and one for the result.
=SUMIF(B5:B15,"jim",D5:D15)
The example returns the sum of the cells in range D5:D15 when the cells in range B5:B15 match the name "jim". This example is similar to the previous one, but this time the condition is a specific name instead of a color.
The SUMIF function is a handy function for adding up a set of cells that match a single specific criteria.