0% found this document useful (0 votes)
54 views7 pages

1.SUMIF-SUMIFS Function

Uploaded by

pankajs311087
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views7 pages

1.SUMIF-SUMIFS Function

Uploaded by

pankajs311087
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

SUMIF function

You use the SUMIF function to sum the values in a range that meet
criteria that you specify. For example, suppose that in a column that
contains numbers, you want to sum only the values that are larger
than 5. You can use the following formula: =SUMIF(B2:B25,">5")

Tips:

▪ If you want, you can apply the criteria to one range and
sum the corresponding values in a different range. For
example, the formula =SUMIF(B2:B5, "John",
C2:C5) sums only the values in the range C2:C5, where
the corresponding cells in the range B2:B5 equal "John."
▪ To sum cells based on multiple criteria, follows SUMIFS
function.

Important: The SUMIF function returns incorrect results when you


use it to match strings longer than 255 characters or to the
string #VALUE!.

Syntax

SUMIF(range, criteria, [sum_range])

The SUMIF function syntax has the following arguments:

▪ range Required. The range of cells that you want


evaluated by criteria. Cells in each range must be numbers
or names, arrays, or references that contain numbers.
Blank and text values are ignored. The selected range
may contain dates in standard Excel format (examples
below).
▪ criteria Required. The criteria in the form of a number,
expression, a cell reference, text, or a function that defines
which cells will be added. Wildcard characters can be
included - a question mark (?) to match any single
character, an asterisk (*) to match any sequence of
characters. If you want to find an actual question mark or
asterisk, type a tilde (~) preceding the character.

For example, criteria can be expressed as 32, ">32", B5,


"3?", "apple*", "*~?", or TODAY().

Important: Any text criteria or any criteria that includes


logical or mathematical symbols must be enclosed in
double quotation marks ("). If the criteria is numeric,
double quotation marks are not required.

▪ sum_range Optional. The actual cells to add, if you want


to add cells other than those specified in
the range argument. If the sum_range argument is
omitted, Excel adds the cells that are specified in
the range argument (the same cells to which the criteria is
applied).

Sum_range should be the same size and shape


as range. If it isn't, performance may suffer, and the
formula will sum a range of cells that starts with the first
cell in sum_range but has the same dimensions
as range. For example:

range sum_range Actual summed cells


A1:A5 B1:B5 B1:B5
A1:A5 B1:K5 B1:B5

Examples

Example 1

Copy the example data in the following table, and paste it in cell A1
of a new Excel worksheet. For formulas to show results, select them,
press F2, and then press Enter. If you need to, you can adjust the
column widths to see all the data.

Property Value Commission Data


$100,000 $7,000 $250,000
$200,000 $14,000
Property Value Commission Data
$300,000 $21,000
$400,000 $28,000
Formula Description Result
=SUMIF(A2:A5,">160000",B2:B5) Sum of the $63,000
commissions for
property values over
$160,000.
=SUMIF(A2:A5,">160000") Sum of the property $900,000
values over $160,000.
=SUMIF(A2:A5,300000,B2:B5) Sum of the $21,000
commissions for
property values equal to
$300,000.
=SUMIF(A2:A5,">" & C2,B2:B5) Sum of the $49,000
commissions for
property values greater
than the value in C2.

Example 2

Copy the example data in the following table, and paste it in cell A1
of a new Excel worksheet. For formulas to show results, select them,
press F2, and then press Enter. If you need to, you can adjust the
column widths to see all the data.

Category Food Sales


Vegetables Tomatoes $2,300
Vegetables Celery $5,500
Fruits Oranges $800
Butter $400
Vegetables Carrots $4,200
Fruits Apples $1,200
Formula Description Result
=SUMIF(A2:A7,"Fruits",C2:C7) Sum of the sales of all $2,000
foods in the "Fruits"
category.
=SUMIF(A2:A7,"Vegetables",C2:C7) Sum of the sales of all $12,000
foods in the
"Vegetables" category.
Category Food Sales
=SUMIF(B2:B7,"*es",C2:C7) Sum of the sales of all $4,300
foods that end in "es"
(Tomatoes, Oranges,
and Apples).
=SUMIF(A2:A7,"",C2:C7) Sum of the sales of all $400
foods that do not have
a category specified.

SUMIFS function
The SUMIFS function, one of the math and trig functions, adds all
of its arguments that meet multiple criteria. For example, you would
use SUMIFS to sum the number of retailers in the country who (1)
reside in a single zip code and (2) whose profits exceed a specific
dollar value.

Syntax

SUMIFS(sum_range, criteria_range1, criteria1,


[criteria_range2, criteria2], ...)

▪ =SUMIFS(A2:A9,B2:B9,"=A*",C2:C9,"Tom")
▪ =SUMIFS(A2:A9,B2:B9,"<>Bananas",C2:C9,"Tom")

Argument name Description


Sum_range (required) The range of cells to sum.
Criteria_range1 (required) The range that is tested
using Criteria1.

Criteria_range1 and Criteria1 set up a


search pair whereby a range is
searched for specific criteria. Once
items in the range are found, their
corresponding values
in Sum_range are added.
Criteria1 (required) The criteria that defines which cells
in Criteria_range1 will be added. For
example, criteria can be entered
as 32, ">32", B4, "apples", or "32".
Argument name Description
Criteria_range2, criteria2, Additional ranges and their associated
… (optional) criteria. You can enter up to 127
range/criteria pairs.

Examples

To use these examples in Excel, drag to select the data in the


table, right-click the selection, and pick Copy. In a new worksheet,
right-click cell A1 and pick Match Destination
Formatting under Paste Options.

Quantity Sold Product Salesperso


n
5 Apples Tom
4 Apples Sarah
15 Artichokes Tom
3 Artichokes Sarah
22 Bananas Tom
12 Bananas Sarah
10 Carrots Tom
33 Carrots Sarah
Formula Description
=SUMIFS(A2:A9, Adds the number of products
B2:B9, "=A*", C2:C9, that begin with A and were sold
"Tom") by Tom. It uses the wildcard
character *
in Criteria1, "=A*" to look for
matching product names
in Criteria_range1 B2:B9, and
looks for the
name "Tom" in Criteria_range
2 C2:C9. It then adds the
numbers in Sum_range A2:A9
that meet both conditions. The
result is 20.
=SUMIFS(A2:A9, Adds the number of products
B2:B9, that aren’t bananas and are
"<>Bananas", sold by Tom. It excludes
C2:C9, "Tom") bananas by using <> in
the Criteria1, "<>Bananas",
and looks for the
Quantity Sold Product Salesperso
n
name "Tom" in Criteria_range
2 C2:C9. It then adds the
numbers in Sum_range A2:A9
that meet both conditions. The
result is 30.

Common Problems

Problem Description
0 (Zero) is shown instead Make sure Criteria1,2 are in quotation
of the expected result. marks if you are testing for text values, like
a person's name.
The result is incorrect TRUE and FALSE values
when Sum_range has for Sum_range are evaluated differently,
TRUE or FALSE values. which may cause unexpected results when
they're added.

Cells in Sum_range that contain TRUE


evaluate to 1. Those that contain FALSE
evaluate to 0 (zero).

Best practices

Do this Description
Use wildcard Using wildcard characters like the question mark
characters. (?) and asterisk (*) in criteria1,2 can help you find
matches that are similar but not exact.

A question mark matches any single character. An


asterisk matches any sequence of characters. If
you want to find an actual question mark or
asterisk, type a tilde (~) in front of the question
mark.

For example, =SUMIFS(A2:A9, B2:B9, "=A*",


C2:C9, "To?") will add all instances with name that
begin with "To" and ends with a last letter that
could vary.
Understand the The order of arguments differs between SUMIFS
difference between and SUMIF. In particular,
the sum_range argument is the first argument in
Do this Description
SUMIF and SUMIFS, but it is the third argument in SUMIF.
SUMIFS. This is a common source of problems using these
functions.

If you're copying and editing these similar


functions, make sure you put the arguments in the
correct order.
Use the same The Criteria_range argument must contain the
number of rows same number of rows and columns as
and columns for the Sum_range argument.
range arguments.

You might also like