How to use SUMIF in Excel

Learn how to use SUMIF in Excel to add cells based on a condition. See formula examples, syntax, common mistakes, and try hands-on practice.

Syntax

=SUMIF(range, criteria, [sum_range])

Arguments

What SUMIF does

SUMIF adds values in a range that meet one condition you specify. You can test numbers against a threshold or check text in one column and add matching amounts from another.

Sum values that meet a condition

When your condition and the values to add are in the same column, pass two arguments: the range and the criteria. Enclose comparison operators in quotation marks. Here, the formula adds all sales amounts greater than 50.

ItemSales
Vase65
Bowl30
Mug85
Plate45
Total

Formula: =SUMIF(B2:B5,">50") → 150

Sum matching values from another column

To check one column and add numbers from a different column, add sum_range as the third argument. The formula checks the category in column A and adds the box counts in column B for matching rows.

CategoryBoxes
Bread14
Pastry22
Bread18
Cake9
Total

Formula: =SUMIF(A2:A5,"Bread",B2:B5) → 32

Common mistake: missing quotes around operators

When your criteria uses comparison operators such as >, <, or <>, you must enclose both the operator and the number in quotation marks, like ">50". Writing =SUMIF(B2:B5, >50) without quotes causes a syntax error. To combine an operator with a cell reference such as C1, join them with an ampersand: ">"&C1.

Related guides

SUMCOUNTIF