This syntax takes a little getting used to.

See below for many working examples.

When cells meet the criteria, corresponding cells in thesum_rangeare summed.

SUMIF function basic example

Ifsum_rangeis omitted, the cells inrangeare summed instead.

In the worksheet below, we have a small amount of sales data.

The tricky part about using the SUMIF function is the syntax needed to apply criteria.

SUMIF function basic example

This is because SUMIF is in a group ofeight functionsthat split logical criteria into two parts:rangeandcriteria.

Because of this design, operators must be enclosed in double quotes ("").

This makes it easy to change criteria later without editing the original formula.

SUMIF function basic example

Notice the greater than operator (>), which is text, must be enclosed in quotes.

The most reliable way to do this is to refer to avalid datein another cell or use theDATE function.

to match a question mark (?)

SUMIF function basic example

that occurs at the end of “Montana?”

The tilde (~) is an escape character that allows you to find aliteralwildcard.

To match a question mark (?

SUMIF function basic example

), use “~?

For more details,see this example.

Summary Table

you could use SUMIF to create a simple summary table.

SUMIF with variable criteria

In the worksheet below, we have a list of unique colors in F5:F9.

The goal is to subtotal the amounts in column D by color.

For more advanced users, this is an important limitation in how SUMIF works and what it can do.

SUMIF not equal to criteria

One of the more tricky limitations of SUMIF is that it won’t allow anarrayfor arangeargument.

This would be cool if it worked.

However, Excel won’t even let you enter this formula.

SUMIF blank and not blank

If you try, you’ll get a generic “There’s a problem with your formula” error.

However, SUMIF is not programmed to handle arrays, so it won’t work.

How can we work around this problem?

SUMIF with dates

However, the latest version of Excel offers powerful alternatives, includingBYROW,BYCOL, andGROUPBY.

SUMPRODUCT Function

The Excel SUMPRODUCT function multipliesrangesorarraystogether and returns the sum of products.

SUMIF function wildcard example

SUMIF function summary table example

SUMIF function array problem error example

SUMIF function array problem example

Excel formula: Sum and ignore errors

Excel formula: Sum by group

Excel formula: Sum time

Excel formula: Sum if cells are not equal to

Excel formula: Sum if cells are equal to

Excel formula: Sum across multiple worksheets with criteria

Excel formula: Sum if greater than

Excel formula: Sum if less than

Excel formula: Sum if x or y

Excel formula: Subtotal invoices by age

Excel formula: Sum if cell contains text in another cell

Excel formula: Count numbers with leading zeros

Excel formula: Sum if ends with

Excel formula: Sum if begins with

Excel formula: Sum if cells contain specific text

Article image

Article image

Article image

Excel COUNTIF function

Excel SUMIFS function

Excel SUMPRODUCT function

SUMIF function basic example

SUMIF not equal to criteria

SUMIF blank and not blank

SUMIF with dates

SUMIF function wildcard example

SUMIF function summary table example

SUMIF function array problem error example

SUMIF function array problem example