SUMIF (sum if condition is true)

<< Click to Display Table of Contents >>

SUMIF (sum if condition is true)

Syntax:

SUMIF(Range, Criterion [, SumRange])

Description:

Returns the sum of those values in a cell range that fulfill the specified criterion.

Range is the cell range to be evaluated.

Criterion is the condition that the values in Range have to fulfill to be included:

Use numbers or text (like "42" or "bolts") to obtain the sum of all cells that contain that value.

Use conditions (like ">10" or "<=5") to sum all cells that match the specified condition.

Note: Criteria always have to be surrounded by double quotation marks (").

SumRange (optional) lets you specify the cell range containing the values to be summed. If omitted, the values in Range will be summed.

Example:

If the cells A1:A5 contain the values 1, 2, 3, 2, 1. The following applies:

SUMIF(A1:A5, "2") returns 2+2, which is 4

SUMIF(A1:A5, ">=2") returns 2+3+2, which is 7

You enter your daily income in a table – like this:

sumif_sample

How much is the sum of the sales, if you only consider sales larger than € 40?

SUMIF(D2:D5, ">40") results in 100.80 Euro

How many flowers of the type "roses" were sold?

SUMIF(C2:C5, "Roses", B2:B5) returns 18

In the above formula, the optional SumRange argument was used: The Range C2:C5 (that is, the type) was searched, but the numbers to be added were taken from the SumRange B2:B5 (that is, the number of pieces).

See also:

AVERAGEIF, AVERAGEIFS, SUM, SUMIFS, COUNTIF, COUNTIFS