SUMIF

Returns the sum of all cell values in a cell-range which meet a given criterion. To specify multiple criteria please use SUMIFS.

Syntax

=SUMIF(DataRange, Criterion, [SumRange])

Arguments

NameDescription
DataRangeCell-range to calculate sum for.
CriterionThe criterion each cell has to fulfill.
SumRangeOptional. If given these cells are used to calculate total sum. If ommitted DataRange is used.

Return Value

The sum of all cell values which meet criterion.

Example

AB
1100000200
2200000400
3300000400
4North600
5East800
6South1000
FunctionResultComment
SUMIF(A1:A3, "250000")300000Only cells A1 and A2 match given criterion.
SUMIF(A1:A6, "=*th", B1:B6)1600Take cells from colum A which end with "th" and average corresponding values from column B.