This tutorial explains the difference between the SUMIF and SUMIFS functions in terms of their syntax and usage, and provides a number of formula examples to sum values with multiple AND / OR criteria in Excel 2016, 2013, 2010, 2007, 2003 and lower.
As everyone knows, Microsoft Excel provides an array of functions to perform various calculations with data. A few articles ago, we explored COUNTIF and COUNTIFS, which are designed for counting cells based on a single condition and several conditions, respectively. Last week we covered Excel SUMIF that adds values meeting the specified criteria. Now it's time to go over the plural version of SUMIF  Excel SUMIFS that allows summing values by multiple criteria.
Those who are familiar with the SUMIF function might think that converting it to SUMIFS takes just an extra "S" and a few additional criteria. This would seem quite logical… but "logical" it's not always the case when dealing with Microsoft : )
The SUMIF function is used to conditionally sum values based on a single criteria. We discussed its syntax in detail in the previous article, so let me give you just a quick summary now.
range
 the range of cells to be evaluated by your criteria, required.criteria
 the condition that must be met, required.sum_range
 the cells to sum if the condition is met, optional.As you see, the syntax of the Excel SUMIF function allows for one condition only. And still, we say that Excel SUMIF can be used to sum values with multiple criteria. How can that be? By adding the results of several SUMIF functions and by using SUMIF formulas with array criteria, as demonstrated in the examples that follow.
You use SUMIFS in Excel to find a conditional sum of values based on multiple criteria. The SUMIFS function was introduced in Excel 2007, so you can use it in all modern versions of Excel 2016, 2013, 2010 and 2007.
Compared to SUMIF, the SUMIFS syntax is a little bit more complex:
The first 3 arguments are mandatory, additional ranges and their associated criteria are optional.
sum_range
 one or more cells to sum, required. This can be a single cell, a range of cells or a named range. Only cells with numbers are summed; blank and text values are ignored.criteria_range1
 the first range to be evaluated by the associated criteria, required.criteria1
 the first condition that must be met, required. You can supply the criteria in the form of a number, logical expression, cell reference, text or another Excel function. For example you can use criteria such as 10, ">=10", A1, "cherries" or TODAY().criteria_range2, criteria2, …
 these are additional ranges and criteria associated with them, optional. You can use up to 127 range/criteria pairs in SUMIFS formulas.And now, let's have a look at the Excel SUMIFS formula with two conditions. Suppose, you have a table listing the consignments of fruit from different suppliers. You have the fruit names in column A, suppliers' names in column B, and quantity in column C. What you want is to find out a sum of amounts relating to a given fruit and supplier, e.g. all apples supplied by Pete.
When you're learning something new, it's always a good idea to start with simple things. So, to begin with, let's define all the arguments for our SUMIFS formula:
Now assemble the above parameters, and you will get the following SUMIFS formula:
=SUMIFS(C2:C9, A2:A9, "apples", B2:B9, "Pete")
To refine the formula further, you can replace the text criteria "apples" and "Pete" with cell references. In this case, you won't have to change the formula to calculate the quantity of other fruit from a different supplier:
=SUMIFS(C2:C9, A2:A9, F1, B2:B9, F2)
Since the aim of this tutorial is to cover all possible ways to sum values by several conditions, we will discuss formula examples with both functions  Excel SUMIFS and SUMIF with multiple criteria. To use them correctly, you need to clearly understand what these two functions have in common and in what way they are different.
While the common part is clear  similar destination and parameters  the differences are not so obvious, though very essential.
In Excel SUMIF and SUMIFS functions, the order of arguments is different. In particular, sum_range is the 1st parameter in SUMIFS, but it is 3^{rd} in SUMIF.
At first sight, it may seem that Microsoft deliberately complicates the learning curve for its users. However, upon a closer look, you will see the reasoning behind it. The point is that sum_range is optional in SUMIF. If you omit it, no problem, your SUMIF formula will sum values in the range (first parameter).
In SUMIFS, the sum_range is very important and obligatory, and that is why it comes first. Probably Microsoft guys thought that after adding the 10^{th} or 100^{th} range / criteria pair, someone might forget to specify the range to sum : )
In the SUMIF function, the sum_range argument does not necessarily have to be of the same size as the range argument, as long as you have the top left cell right. In Excel SUMIFS, each criteria_range must contain the same number of rows and columns as the sum_range parameter.
For example, =SUMIF(A2:A9,F1,C2:C18)
will return the correct result because Excel considers only the upper leftmost cell in the sum_range argument (C2 in this example, which is correct), and then includes as many columns and rows as contained in the range argument.
The SUMIFS formula =SUMIFS(C2:C9, A2:A9, "apples", B2:B10, "Pete")
will return the #VALUE! error because criteria_range2 (B2:B10) does not match in size criteria_range1 (A2:A9) and sum_range (C2:C9).
Alright, enough strategy (i.e. theory), let's get into the tactics (i.e. formula examples : )
A moment ago, we discussed a simple SUMIFS formula with two text criteria. In the same manner, you can use Excel SUMIFS with multiple criteria expressed by numbers, dates, logical expressions, and other Excel functions.
In our fruit suppliers table, suppose, you want to sum all deliveries by Mike with Qty. 200 or more. To do this, you use the comparison operator "greater than or equal to" (>=) in criteria2 and get the following SUMIFS formula:
=SUMIFS(C2:C9,B2:B9,"Mike",C2:C9,">=200")
We covered all possible comparison operators in detail when discussing Excel SUMIF function, the same operators can be used in SUMIFS criteria. For example, the following formula with return the sum of all values in cells C2:C9 that are greater than or equal to 200 and less than or equal to 300.
=SUMIFS(C2:C9, C2:C9,">=200", C2:C9,"<=300")
In case you want to sum values with multiple criteria based on the current date, use the TODAY() function in your SUMIFS criteria, as demonstrated below. The following formula sums values in column D if a corresponding date in column C falls within the last 7 days, including today:
=SUMIFS(D2:D10, C2:C10,">="&TODAY()7, C2:C10,"<="&TODAY())
In a similar fashion, you can use the Excel SUMIF function to sum values in a given date range. For example, the following SUMIFS formula adds the values in cells C2:C9 if a date in column B falls between 1Oct2014 and 31Oct2014, inclusive.
=SUMIFS(C2:C9, B2:B9, ">=10/1/2014", B2:B9, "<=10/31/2014")
The same result can be achieved by calculating the difference of two SUMIF functions, as demonstrated in this example  How to use SUMIF to sum values in a given date range. However, Excel SUMIFS is much easier and more understandable, isn't it?
When analyzing reports and other data, you may often need to sum values corresponding either to empty or nonempty cells.
Criteria  Description  Formula Example  
Blank cells  "="  Sum values corresponding to blank cells that contain absolutely nothing  no formula, no zero length string.  =SUMIFS(C2:C10, A2:A10, "=", B2:B10, "=")
Sum values in cells C2:C10 if the corresponding cells in columns A and B are absolutely empty. 
""  Sum values corresponding to "visually" blank cells including those that contain empty strings returned by some other Excel function (for example, cells with a formula like ="").  =SUMIFS(C2:C10, A2:A10, "", B2:B10, "")
Sum values in cells C2:C10 with the same conditions as the above formula, but includes empty strings. 

Nonblank cells  "<>"  Sum values corresponding to nonempty cells, including zero length strings.  =SUMIFS(C2:C10, A2:A10, "<>", B2:B10, "<>")
Sum values in cells C2:C10 if the corresponding cells in columns A and B are not empty, including cells with empty strings. 
SUMSUMIF or SUM / LEN 
Sum values corresponding to nonempty cells, not including zero length strings.  =SUM(C2:C10)  SUMIFS(C2:C10, A2:A10, "", B2:B10, "")
=SUM((C2:C10) * (LEN(A2:A10)>0)*(LEN(B2:B10)>0)) Sum values in cells C2:C10 if the corresponding cells in columns A and B are not empty, cells with zero length strings are not included. 
And now, let's see how you can use a SUMIFS formula with "blank" and "nonblank" criteria on real data.
Suppose, you have an order date in column B, delivery date in column C and Qty. in column D. How do you find the total of products that have not been delivered yet? That is, you want to know the sum of values corresponding to nonempty cells in column B and empty cells in column C.
The solution is to use the SUMIFS formula with 2 criteria:
=SUMIFS(D2:D10, B2:B10,"<>", C2:C10,"=")
As noted in the beginning of this tutorial, the SUMIFS function is designed with AND logic. But what if you need to sum values with multiple OR criteria, i.e. when at least one of the conditions is met?
The simplest solution is to sum the results returned by several SUMIF functions. For example, the following formula demonstrates how to find the total of products delivered by Mike and John:
=SUMIF(C2:C9,"Mike",D2:D9) + SUMIF(C2:C9,"John",D2:D9)
As you see, the first SUMIF function adds the quantities corresponding to "Mike", the other SUMIF function returns the amounts relating to "John" and then you add these 2 numbers.
The above solution is very simple and may get the job done quickly when there are only a couple of criteria. But a SUMIF + SUMIF formula may grow up enormously if you want to sum values with multiple OR conditions. In this case, a better approach is using an array criteria argument in the SUMIF function. Let's examine this approach now.
You can start by listing all of your conditions separated by commas and then enclose the resulting commaseparated list in {curly brackets}, which is technically called an array.
In the previous example, if you want to sum the products delivered by John, Mike and Pete, your array criteria will look like {"John","Mike","Pete"}. And the complete SUMIF function is SUMIF(C2:C9, {"John","Mike","Pete"} ,D2:D9)
.
The array argument consisting of 3 values forces your SUMIF formula to return three separate results, but since we write the formula in a single cell, it would return the first result only  i.e. the total of products delivered by John. To get this arraycriteria approach to work, you have to use one more little trick  enclose your SUMIF formula in a SUM function, like this:
=SUM(SUMIF(C2:C9, {"John","Mike","Pete"} , D2:D9))
As you see, an array criteria makes the formula much more compact compared to SUMIF + SUMIF, and lets you add as many values as you like in the array.
This approach works with numbers as well as with text values. For instance, if instead of the suppliers' names in column C, you had supplier IDs like 1, 2, 3 etc., then your SUMIF formula would look similar to this:
=SUM(SUMIF(C2:C9, {1,2,3} , D2:D9))
Unlike text values, numbers needn't be enclosed in double quotes in array arguments.
In case, your preferred way is to list the criteria in some cells rather that specify them directly in the formula, you can use SUMIF in conjunction with the SUMPRODUCT function that multiplies components in the given arrays, and returns the sum of those products.
=SUMPRODUCT(SUMIF(C2:C9, G2:G4, D2:D9))
Where G2:G4 are the cells containing your criteria, the suppliers' names in our case, as illustrated in the screenshot below.
But of course, nothing prevents you from listing the values in an array criteria of your SUMIF function if you want to:
=SUMPRODUCT(SUMIF(C2:C9, {"Mike","John","Pete"}, D2:D9))
The result returned by both formulas will be identical to what you see in the screenshot:
If you want to conditionally sum values in Excel not simply with multiple OR conditions, but with several sets of conditions, you will have to use SUMIFS instead of SUMIF. The formulas will be very similar to what we've just discussed.
As usual, an example might help to illustrate the point better. In our table of fruit suppliers, let's add the Delivery Date (column E) and find the total quantity delivered by Mike, John and Pete in October.
The formula produced by this approach includes a lot of repetition and looks cumbersome, but it is easy to understand and, most importantly, it works : )
=SUMIFS(D2:D9,C2:C9, "Mike", E2:E9,">=10/1/2014", E2:E9, "<=10/31/2014") +
SUMIFS(D2:D9, C2:C9, "John", E2:E9, ">=10/1/2014", E2:E9, "<=10/31/2014") +
SUMIFS(D2:D9, C2:C9, "Pete", E2:E9, ">=10/1/2014" ,E2:E9, "<=10/31/2014")
As you see, you write a separate SUMIFS function for each of the suppliers and include two conditions  equal to or greater than Oct1 (">=10/1/2014",) and less than or equal to Oct 31 ("<=10/31/2014"), and then you sum the results.
I've tried to explain the essence of this approach in the SUMIF example, so now we can simply copy that formula, change the order of arguments (as you remember it is different in SUMIF and SUMIFS) and add additional criteria. The resulting formula is more compact than SUMIFS + SUMIFS:
=SUM(SUMIFS(D2:D9,C2:C9, {"Mike", "John", "Pete"}, E2:E9,">=10/1/2014", E2:E9, "<=10/31/2014"))
The result returned by this formula is exactly the same as you see in the screenshot above.
As you remember, the SUMPRODUCT approach differs from the previous two in the way that you enter each of your criteria in a separate cell rather that specify them directly in the formula. In case of several criteria sets, the SUMPRODUCT function won't suffice and you will have to employ ISNUMBER and MATCH as well.
So, assuming that the Supplies Names are in cells H1:H3, Start Date is in cell H4 and End Date in cell H5, our SUMPRODUCT formula takes the following shape:
=SUMPRODUCT((E2:E9>=H4), (E2:E9<=H5), (ISNUMBER(MATCH(C2:C9, H1:H3,0))), D2:D9)
Many people wonder why use double dash () in SUMPRODUCT formulas. The point is that Excel SUMPRODUCT ignores all but numeric values, while the comparison operators in our formula return Boolean values (TRUE / FALSE), which are nonnumeric. To convert these Boolean values to 1's and 0's, you use the double minus sign, which is technically called the double unary operator. The first unary coerces TRUE/FALSE to 1/0, respectively. The second unary negates the values, i.e. reverses the sign, turning them into +1 and 0, which the SUMPRODUCT function can understand.
I hope the above explanation makes sense. And even if it doesn't, just remember this rule of thumb  use the double unary operator () when you are using comparison operators in your SUMPRODUCT formulas.
As you remember, Microsoft implemented the SUMIFS function in Excel 2007. If someone still uses Excel 2003, 2000 or earlier, you will have to use a SUM array formula to add values with multiple AND criteria. Naturally, this approach works in modern versions of Excel 2013  2007 too, and can be deemed an oldfashioned counterpart of the SUMIFS function.
In the SUMIF formulas discussed above, you have already used array arguments, but an array formula is something different.
Let's get back to the very first example where we found out a sum of amounts relating to a given fruit and supplier:
As you already know, this task is easily accomplished using an ordinary SUMIFS formula:
=SUMIFS(C2:C9, A2:A9, "apples", B2:B9, "Pete")
And now, let's see how the same task can be fulfilled in early "SUMIFSfree" versions of Excel. First off, you write down all the conditions that should be met in the form of range="condition". In this example, we have two range/condition pairs:
Condition 1: A2:A9="apples"
Condition 2: B2:B9="Pete"
Then, you write a SUM formulas that "multiplies" all of your range/condition pairs, each enclosed in brackets. The last multiplier is the sum range, C2:C9 in our case:
=SUM((A2:A9="apples") * ( B2:B9="Pete") * ( C2:C9))
As illustrated in the screenshot below, the formula perfectly works in the latest Excel 2013 version.
Even in modern versions of Excel 2016, 2013, 2010 or 2007, the power of the SUM function should not be underestimated. The SUM array formula is not simply gymnastics of the mind, but has a practical value, as demonstrated in the following example.
Suppose, you have two columns, B and C, and you need to count how many times column C is greater than column B, when a value in column C is greater or equal to 10. An immediate solution that comes to mind is using the SUM array formula:
=SUM((C1:C10>=10) * (C1:C10>B1:B10))
Don't see any practical application to the above formula? Think about it in another way : )
Suppose, you have the orders list like shown in the screenshot below and you want to know how many products have not been delivered in full by a given date. Translated into Excel's language, we have the following conditions:
Condition 1: A value in column B (Ordered items) is greater than 0
Condition 2: A value in column C (Delivered) in less than in column B
Condition 3: A date in column D (Due date) is less than 11/1/2014.
Putting the three range/condition pairs together, you get the following formula:
=SUM((B2:B10>=0)*(B2:B10>C2:C10)*(D2:D10<G2))
Well, the formula examples discussed in this tutorial have only scratched the surface of what Excel SUMIFS and SUMIF functions can really do. But hopefully, they have helped pointing you in the right direction and now you can sum values in your Excel workbooks no matter how many intricate conditions you have to consider.
440 Responses to "How to use Excel SUMIFS and SUMIF with multiple criteria  formula examples"
I need to know how many times person × shows a specific ID# and thier costs. Any suggestions? I've gotten it to work with the person # and costs but I'm not sure how to add in their specific ID# and carry it down to the rest of the group. Can I put multiple ID#'s in parenthesis so it finds the one that has that person # and that specific ID#?
Hi, I am wanting to count the number of set (text) entries on certain dates: today / last 7days / last 30days.
I.e  how many “client defers” in column C do I have recorded today / last 7 / last 30  date recorded in column B, would love someone to help. Thanks
how is the solution if I need 3 criteria and 3 sum like the example I made by combining with & which is actually wrong, but I don't understand how to combine them so that the desired results are achieved: = (SUMIF ($ B5, P $ 3, $ E5: $ I5 )) & (SUMIF ($ C5, Q $ 3, $ J5: $ L5)) & (SUMIF ($ D5, R $ 3, $ M5: $ N5)) and the results are not as I expected, please take a solution, Thank you
Excel would evaluate the farmola =20*10/5*8 return answer
Hi, I am looking for a more compressed way to write this formula.
I have three different Criteria ranges and three different Sum ranges for each criteria.
The formula is copied down from row to row and the criteria changes with each move but the criteria range and the sum range must be fixed, requiring the use of fixed and relational references. This was coppied from cell AF6.
=IF(AK6+(2*(SUMIF($F$6:$F$48,AG6,$A$6:$A$49) + SUMIF($L$6:$L$48,AG6,$M$6:$M$49) + SUMIF($S$6:$S$48,AG6,$N$6:$N$48)))=0,"",AK6+(2*(SUMIF($F$6:$F$48,AG6,$A$6:$A$49) + SUMIF($L$6:$L$48,AG6,$M$6:$M$49) + SUMIF($S$6:$S$48,AG6,$N$6:$N$48))))
Hi may someone help in this,
I want to sum only the negative numbers from U column. What should I add to this formula?
=SUMIFS('Detailed accounting'!$U:$U,'Detailed accounting'!$N:$N,$A9,'Detailed accounting'!$C:$C,B$2,'Detailed accounting'!$K:$K,"USD")
Thanks
Hi I am using this formaula =SUM(SUMIF(C2:C9, {"John","Mike","Pete"} , D2:D9)). What I would like to do is create a name for the {"John","Mike","Pete"}. Trouble is when I put the name into the formula it represents it like this "{"John","Mike","Pete"}" and the formula fails. How do I stop it text qualifying. Thanks
Thanks
I want to calculate three different types of matching with consolidate sumif calculations. EX. "date", need to match, "Company Name" should match and "Name"
I have 2 spreadsheets with several variables that I need to sum.
Spreadsheet 1
Column A Employee number
Column B date range from
Column C date range 2
Spreadsheet 2
Column A Employee number
Column B Payment date
Column C Payment amount
So basically I want to sum all amounts paid to an employee where payment date on spreadsheet 2 falls on the date range on spreadsheet 1.
Thank you
Thanks Svetlana from Indonesia
Hello,
Can anyone help me on the formula which is partially working..
=SUM(SUMIFS('ETPTFS Data'!$AH$3:$AH$136,'ETPTFS Data'!$F$3:$F$136,{"72101290","72101210"},'ETPTFS Data'!$B$3:$B$136,">=1/10/2019",'ETPTFS Data'!$B$3:$B$136,"<31/10/2019"))
This formula is picking only first row withing Oct 2019 month, while the other rows are ignored.
Look forward to solution.
Archer
Hi,
Can the one condition in Sumifs be a row condition and another a column condition? The numbers of rows in the row condition and number of columns in the column condition are the same as the sum range, but I still get a #VALUE result
Try looking for the formula =SUMIF(INDEX(MATCH)
I have a datasheet where regular pay is column K and overtime hours is column L. I was told to find How much regular pay and overtime pay did they pay to each individual employee by Calculating the amounts for regular and overtime pay separately using the SUMIF or SUMIFS function. Each employee has multiple rows. How would I set up this formula?
Hello,
I am trying to do a sum function in for the number of rows depending on the number of month we are in. For example columns C through N are for the months Jan  Dec. On a separate Cell number 5 for "May". I want to be able to add columns C through G for Jan  May. Can this be done?
Hi there
I'm trying to sum info in a slightly different format. If in your first example if the supplier names (John, Mike,Pete) were in cells B1D1 and all the sales were in B2D9 under their names, I'm wanting to get the total number of fruit from each supplier on a separate sheet. ie Sumif John and Apples.
It should be an easy solution, but I'm not getting it  can you please assist?
amount days value
100000 215 1767 (formala =a*d*3/36500)
i want calculate amount 100000 calculate only one lack
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 .
HOW TO AVOID TOTALS TO CHANGE IN SUMIFS FORMULAS WHEN YOU FILTER THE DATA
Hi
Please help me with this table
I have this table. A,B,C are the excel columns and 1,2 3 .... are the rows.
A B C
1 Daily Price update
2 Apple 2.6
3 Banana 10
4
5 Type of fruit Last days price Today’s price
6 10
My requirement is that when I make an entry in A6 (type of fruit), it should check value from A2 or A3
Then it should add value of B6 as per values given in B2 or B3 as per entered value.
Hello Keshav!
If I understand your task correctly, you need to use value search with the VLOOKUP function. You can learn more about VLOOKUP in Excel in this article on our blog.
Hope you’ll find this information helpful.
How do I calculate the total sum in a column which is attached too separate conditions in two different columns?
Eg: Sum column D if any of the column A (is>700 and 700 and <1400).
Which formula will work for this scenario?
Hello Akash!
Read carefully the article above. Use a formula like this
=SUMIFS(D1:D10,A1:A10,">700")
For me to be able to help you better, please describe your task in more detail. It’ll help me understand it better and find a solution for you. Thank you.
Hello, Please help and thank you in advance!!
I have a formula to sum values "TimeSheet!E:E" according to month selected "AC2" and by ID & Emp, but what I have been struggling with is the other part of the formula if a month is not selected and a quarter is selected.
Instead of months as text, I use 112 to simplify formula. This is the formula that I am using.
=SUM((MONTH(TimeSheet!$G:$G)=$AC$2)*(TimeSheet!$B:$B=$B5)*(TimeSheet!$J:$J=E$2)**(TimeSheet!$E:$E))
AC2 (Month 112/1Qtr, 2Qtr, 3Qtr, 4Qtr) B:B (Emp Column) E:E (Miles Column) G:G (Dates Column) J:J (ID Column)
The formula I have been trying is:
SUM(SUMIF(AC2,{"1","2","3","4","5","6","7","8","9","10","11","12"},TimeSheet!$J:$J=C$2,TimeSheet!$B:$B=$B5,(MONTH(TimeSheet!$G:$G)=$AC$2,TimeSheet!$E:$E),SUMPRODUCT((ROUNDUP(MONTH(TimeSheet!$G:$G)/3,0)=AC2,YEAR(TimeSheet!$G:$G)=AC2,TimeSheet!$J:$J=C$2,TimeSheet!$B:$B=$B5,TimeSheet!$E:$E))
Hello!
I’m sorry but your task is not entirely clear to me.
For me to be able to help you better, please describe your task in more detail. What exactly do you indicate in cell AC2 (month number or quarter number or date)? What data is stored in column G (date or month number)? Please let me know in more detail what you were trying to find, what formula you used and what problem or error occurred. It’ll help me understand it better and find a solution for you. Thank you.
sir,
I am using sumif formula to sum 3 columns data, but it giving 1column summary.
syntax is:SUMIF(G3:G619,H621,C3:E619).
pl advice , how to correct it.
I have received 25 items and want to deliver 5 person. Can you please help to set the formula.
As a general comment on SUMIFS; note that if none of the criteria are met, the result is zero, not an error of some kind.