​​​​Sumif

The Excel SUMIF function sums the values in a given cell range if they meet the specified condition.

Syntax

=SUMIF(Range, Condition, [Sum range])

Argument  Argument description
1RangeThe cell range that the condition is applied to.
If you don’t use the Sum range argument, Rangeis summed instead.
2ConditionThe condition that determines which values are summed.
3Sum range (Optional)The cells that will be summed up.
If you don’t use the Sum range argument, Rangeis summed instead.

Example 1: Simple Excel Sumif formula

A barebones example of a Sumif formula can look like this:

=SUMIF(A1:A3, " >1")
Simple Excel SUMIF example. Given a cell range with values 1, 2 and 3, and the condition > 1, the Sumif function returns 5.
Simple SUMIF example. Given a cell range with values 1, 2 and 3, and the condition > 1, the Sumif function returns 5.

Explanation

The result is 5 because the formula checks for each value in cells A1, A2 and A3 if they meet the condition given. The condition is “> 1”, so values have to be larger than 1.

Let’s walk through the values: 1 is not larger than 1. 2 is larger than 1. And 3 is also larger than 1. So 2 and 3 meet the condition and are added together. 2 + 3 = 5 and therefore the resulting value is 5.

Example 2: Sum range

In the above example, the Range argument is used as both the range that is summed and the range that the condition is applied to.

We can separate these two functionalities using the Sum range argument. When this argument is used, the cells in Range will only be used to check if they meet the condition. The cells in Sum range will only be used to sum. Here’s a quick example:

Summing the values in Sum range if the corresponding value in Range is "Yes".
Summing the values in Sum range if the corresponding value in Range is “Yes”.

Explanation

The returned value is 40 because we are looking in Range B2:B4 for cells that contain the text Yes. There are two cells that meet this condition B2 and B4, the first and third cell in the range.

Then, we sum the values in Sum range C2:C4 if their corresponding value in Range meets the condition. We know that the first and third cell met the condition, so the first and third cell of the Sum range are summed: 10 + 30 = 40. And 40 is returned.

Example 3: Wildcards and Sumif

The Sumif function allows for all sorts of conditions as Condition argument. They can be texts, numbers and dates. They can be combined with conditional operators or functions that return TRUE or FALSE. For more information on different types of conditions, check out this section of our complete guide on the If function.

Another thing that’s allowed is the use of wildcards in the Conditionargument.

Wildcards are characters like ? and * that allow you to search for an approximate match instead of an exact word match.

Note: for more information on wildcards, check this section about wildcards from our Find and Replace post.

Here’s an example formula where we use the asterisk (*) wildcard to match with a last name regardless of first name.

Using Excel Sumif with an asterisk (*) wildcard to sum the ages of the Collins family.
Using Sumif with an asterisk (*) wildcard to sum the ages of the Collins family.

Explanation

123 is returned because that is the sum of the ages of the members of the Collins family (50 + 51 + 22 = 123).

The condition *Collins matches with any names ending in Collins, regardless of what text is before that. Therefore, we match with every Collins family member and we use the Sum range argument to sum their ages.

Questions

Can I use multiple conditions with a Sumif function?

Yes, you can. The easiest way to do this is by using the Sumifs function, which allows for multiple (range, condition) pairs.
An alternative with one range and multiple conditions is to use the regular Sumif function, combined with logical operators (And, Or, Not, Xor).

Can an array be used instead of a cell range?

No, the Sumif and Sumifs functions are not compatible with arrays as input argument. You can use the Sumproduct function as a workaround.

Is Sumif case sensitive?

No, Sumif is not case sensitive. So if your condition is “POTTER” you will also find Potter, pOTTER and potter.

Drawbacks

The Excel Sumif function has some drawbacks:

  1. We’ve mentioned it before: you cannot use arrays instead of cell ranges with the SUMIF or SUMIFS functions.
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"36c04":{"name":"Main Accent","parent":-1},"3a8fd":{"name":"Accent Light","parent":"36c04","lock":{"saturation":1,"lightness":1}}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"36c04":{"val":"rgb(255, 204, 102)","hsl":{"h":40,"s":1,"l":0.7}},"3a8fd":{"val":"rgb(241, 241, 241)","hsl_parent_dependency":{"h":0,"s":0,"l":0.94}}},"gradients":[]},"original":{"colors":{"36c04":{"val":"rgb(255, 204, 102)","hsl":{"h":40,"s":1,"l":0.7}},"3a8fd":{"val":"rgb(241, 241, 241)","hsl_parent_dependency":{"h":0,"s":0,"l":0.94}}},"gradients":[]}}]}__CONFIG_colors_palette__

​Get Good at Excel on Autopilot

Sign up to our newsletter and receive ​Excel articles, tips and tricks delivered straight to your inbox. All you have to do is read them! ​Plus, to get you started, you'll receive a PDF with 200+ Excel shortcuts.

__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"2dd0d":{"name":"Main Accent","parent":-1}},"gradients":[]},"palettes":[{"name":"Default Palette","value":{"colors":{"2dd0d":{"val":"rgb(45, 164, 92)","hsl":{"h":143,"s":0.57,"l":0.41}}},"gradients":[]},"original":{"colors":{"2dd0d":{"val":"rgb(19, 114, 211)","hsl":{"h":210,"s":0.83,"l":0.45}}},"gradients":[]}}]}__CONFIG_colors_palette__
Join List
>