Excel function

SUMIFfunction

Adds only the values in rows that meet a condition.

All versions
=SUMIF(A2:A9, "Seoul", D2:D9)
Range to drag
A
B
C
D
1
2
3
4
5
6
7
8
9

Drag the corner dots to change range, sum_range. Click a cell in the criteria range to use its value as the criteria. Move range to column C (Qty) and set criteria to ">=20". Try breaking it on purpose to see the errors.

Result

166600

range
A2:A9Drag a corner dot up/down to resize, sideways to change the column

The column checked against the condition.

criteria

The condition that picks the rows to add.

sum_range
D2:D9

The column to add. If omitted, range itself is added.

What is the SUMIF function?

=SUMIF(range, criteria, [sum_range])

SUMIF adds the values in rows that meet one condition: total sales for one branch, the quantity of one product, every amount over 100.

The condition is checked in range, and the numbers are added from the same rows of sum_range. The two ranges can be different columns.

Arguments

range
The cells to check against the condition.
criteria
The condition. Type a value such as "Seoul", a comparison such as ">=20" or "<>Seoul", or a wildcard pattern such as "B*" (* for any characters, ? for one character). Text and comparisons go in double quotes.
sum_range
The cells to add. If omitted, the cells in range are added. SUMIF uses a block the same size as range, starting at the top-left cell of sum_range.

SUMIF examples

  1. Example 1. Total sales for Seoul

    =SUMIF(A2:A9, "Seoul", D2:D9)

    Seoul appears in rows 2, 4 and 7. 45000 + 25600 + 96000 = 166600.

  2. Example 2. Add quantities of 20 or more

    =SUMIF(C2:C9, ">=20")

    sum_range is omitted, so the matching quantities themselves are added: 30 + 20 + 40 + 25 = 115.

  3. Example 3. Condition in a cell

    =SUMIF(A2:A9, ">="&F2, D2:D9)

    Join a comparison and a cell with &. Without the &, ">=F2" is read as the text F2.

Common mistakes

FAQ

How do I use more than one condition?
Use SUMIFS. Note that its argument order is different: sum_range comes first.
Is the condition case-sensitive?
No. "seoul" and "Seoul" match.