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
Example 1. Total sales for Seoul
=SUMIF(A2:A9, "Seoul", D2:D9)Seoul appears in rows 2, 4 and 7. 45000 + 25600 + 96000 = 166600.
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.
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
Comparison without quotes
Write ">=20" with quotes. SUMIF(C2:C9, >=20) is a formula error.
Ranges of different heights
SUMIF doesn't report an error when sum_range is a different size; it silently resizes it to match range. Keep both ranges the same size so the result is what you expect.
Numbers stored as text
Text such as "1500" in sum_range is not added.
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.