Functions
SUMIF
Sum cells where range matches criterion
Try it
When to use it
When should I use SUMIF instead of SUM?
Use SUMIF to total only the cells that meet a condition; use plain SUM when you want to add everything.
When should I use SUMIF instead of COUNTIF?
Use SUMIF to add up the values that match a condition; use COUNTIF when you only want the number of matching cells.
Use cases
Sum amounts that meet a minimum
Total values equal to a target
Used in
Syntax
SUMIF(range, criterion, [sum_range])Examples
=SUMIF({10,20,30,40},">20") // => 70