Excel SUMIFS Function

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Excel SUMIFS Function

Summary
SUMIFS is a function to sum cells that meet multiple criteria. SUMIFS can be used to sum values
when adjacent cells meet criteria based on dates, numbers, and text. SUMIFS supports logical
operators (>,<,<>,=) and wildcards (*,?) for partial matching.

Purpose
Sum cells that match multiple criteria

Return value
The sum of the cells that meet all criteria

Syntax
=SUMIFS (sum_range, range1, criteria1, [range2], [criteria2], ...)

Arguments
 sum_range - The range to be summed.
 range1 - The first range to evaulate.
 criteria1 - The criteria to use on range1.
 range2 - [optional] The second range to evaluate.
 criteria2 - [optional] The criteria to use on range2.
Usage notes
Excel's SUMIFS function sums cells in a range using supplied criteria. Unlike the SUMIF function,
SUMIFS can apply more than one set of criteria, with more than one range. The first range is the
range to be summed. The criteria are supplied in pairs (range/criteria) and only the first pair is
required. For additional criteria, supply an additional range/criteria pair. Up to 127 range/criteria
pairs are allowed.
Examples
In the first example, SUMIFS is configured to sum values in column F when the color in column C
is "red". In the second example, SUMIFS will sum values in column F only when the color is "red"
and the state is Texas (TX).
=SUMIFS(F5:F11,C5:C11,"red") // sum if red
=SUMIFS(F5:F11,C5:C11,"red",D5:D11,"TX") // sum if red and TX
Notes
 Each additional range must have the same number of rows and columns as the sum_range.
 Non-numeric criteria must be enclosed in double quotes, but numeric criteria does not need quotes
except with operators, i.e. ">32"
 The wildcard characters ? and * can be used in criteria. A question mark matches any one character
and an asterisk matches any sequence of characters.
 To find a literal question mark or asterisk, use a tilde (~) in front question mark or asterisk (i.e. ~?,
~*).
 SUMIF and SUMIFS can handle ranges, but not arrays. This means you can't use other functions
like YEAR on the criteria range, since the result is an array. If you need this functionality, use
the SUMPRODUCT function.
 The order of arguments is different between the SUMIFS and SUMIF functions. Sum_range is
the first argument in SUMIFS, but the third argument in SUMIF.

Sum if ends with


Generic formula
=SUMIF(range,"*text",sum_range)

Explanation
To sum if cells end with specific text, you can use the SUMIF function.
In the example shown, cell G6 contains this formula:
=SUMIF(item,"*hat",amount)
This formula sums cells in the named range amount (D5:D11) only if cells in the named
range item (C5:C11) end with "hat".
Note that SUMIF is not case-sensitive. The criteria "*hat" matches any text that ends with "Hat" or
"hat".
How the formula works
This SUMIF formula depends on wildcards. In Excel, an asterisk (*) used as a wildcard means "one
or more characters", while a question mark (?) means "any one character". This feature allows you
to construct criteria such as "begins with", "ends with", "contains 3 characters" and so on.
To match all items that end with "hat" the place an asterisk (*) in front of the match text:
item,"*hat"
Note that you must enclose literal text and the wildcard in double quotes ("").
Alternative with SUMIFS
You can also use the SUMIFS function to sum if cells begin with. SUMIFS can handle multiple
criteria, and the order of the arguments is different from SUMIF. The equivalent SUMIFS formula
is:
=SUMIFS(amount,item,"*hat")
Notice that the sum range always comes first in the SUMIFS function.

You might also like