Excel’s SUMPRODUCT function has some handy uses for Excel 2003 users who desperately want the SUMIFS, COUNTIFS or AVERAGEIFS functions (the *IFS series of functions).
And if you’re an Excel 2007 or 2010 user keep reading because there’s a cool way to use SUMPRODUCT which gets around the limitations of Excel’s *IFS series of functions.
You might like to download the workbook and follow along, reverse engineer the formulas or practice what you learn.
First of all the limitations of the *IFS series of functions:
The *IFS functions only work with AND logic between the criteria.
For example: SUMIFS(sum the range A if range B = criteria 1, AND range C = criteria 2, AND range D = criteria 3…..)
But with SUMPRODUCT we can specify OR logic as well as AND logic in a SUMIF style of calculation.
For example: SUMPRODUCT(range A, if range B = criteria 1, OR range B = criteria 2, AND range C = criteria 3…..)
Note: the configuration of the SUMPRODUCT formula above is for illustration purposes only, the actual syntax of the SUMPRODUCT function is different. See below.
Excel SUMPRODUCT Function Examples
Our data below is laid out in a table that has been converted to a range. Each column has a named range the same as the header in row 1. Therefore in my examples I will refer to the column range G2:G207 as the named range ‘solarSystem’ and so on.

How to use the SUMPRODUCT function Instead of SUMIF
Using the data above let’s say I want to sum the Volume for the Endrulf solar system. My SUMPRODUCT formula would look like this:
=SUMPRODUCT((Volume)*(solarSystem=”Endrulf”))
Ok, so I could do that with a SUMIF, but what if I had more than one criterion?
How to use the SUMPRODUCT function Instead of SUMIFs
This is for you if you’re stuck with Excel 2003!
Let’s say I want to sum the volume for Endrulf solar system AND IF Jumps = 6
=SUMPRODUCT((Volume)*((solarSystem=”Endrulf”)*(jumps=6)))
How to use the SUMPRODUCT to SUMIF with OR as well as AND logic
=SUMPRODUCT((Volume)*((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(jumps=6))
The above formula reads:
=SUM ((Volume) IF ((solarSystem=”Rens”) OR (solarSystem=”Endrulf”)) AND (jumps=6))
In SUMPRODUCT functions you can employ the AND logic, and OR logic using the * and + symbol:
- When the multiplication symbol * is used it reads ‘AND’.
- When the plus symbol + is used it reads ‘OR’.
How the SUMPRODUCT Function Works
Firstly let me say to all those ‘Excel Gurus’ reading that yes, there are many ways to structure a SUMPRODUCT function but to avoid overwhelm I am using what I think is the easiest to understand, and since they all result in the same answer (albeit some may be quicker for Excel to calculate) I figure this is a good way to start getting your head around the SUMPRODUCT function without scaring people away.
In the SUMPRODUCT function Excel is testing for TRUE or FALSE answers, and in Excel the numeric equivalent for TRUE is 1, and for FALSE it is 0.
These are known as Boolean terms….you may remember learning them at school and, if you were like me, you’d have thought ‘why would I ever need to know that’ and promptly filed them away in your memory along with Quadratic Equations and SIN, COS and TAN.
Not to worry, I’ll remind you how they work as they’re really quite straight forward…but you might like to get a snack like the apple at the top of this post (also known as a ‘brain booster’ at my 5 year old’s school).
So, using this formula:
=SUMPRODUCT((Volume)*((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(jumps=6))
Let’s look at our data and take row 4 below as an example and apply the formula:

= 13,417 * 1 * 0 = 0
Explained:
SUM Volume 13,417 * 1 (because G4=Rens therefore = TRUE, which = 1) * 0 (because H4=7 therefore = FALSE which = 0)
Or if we look at row 6:
5,217,955 * 1 * 1 = 5,217,955
How to use the SUMPRODUCT to COUNT with multiple criterion
Using my example; if you want to use SUMPRODUCT to count values based on multiple criterion using AND or OR, you would simply drop the Volume component of the formula like this:
=SUMPRODUCT(((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(jumps=6))
How to use SUMPRODUCT to AVERAGE with multiple criterion
To calculate the AVERAGE we simply divide the total amount by the COUNT of the total volume like this:
=SUMPRODUCT((Volume)*((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(jumps=6)) / SUMPRODUCT(((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(jumps=6))
SUMPRODUCT Using Dates as Criteria
Say I wanted to add the criteria for the month of January 2011 instead of the ‘jumps=6’:
=SUMPRODUCT((Volume)*((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(Date>=DATEVALUE(“01/01/2011″)*(Date<=DATEVALUE(“31/01/2011″))))
Remember the Date could also refer to a cell that contained the date, or the date serial number:
Using cell references for the date (cell L12 contains 1/1/2011 and cell M12 contains 31/1/2011):
=SUMPRODUCT((Volume)*((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(Date>=L12)*(Date<=M12))
Using serial numbers for the date:
=SUMPRODUCT((Volume)*((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(Date>=40544)*(Date<=40574))
SUMPRODUCT as an Alternative to Helper Columns

What say we wanted to know the sum of the Volume x Price. We could insert a formula in column J that calculated Price x Volume for each row of data, and then sum column J to get a total, or we could use the SUMPRODUCT function like this:
=SUMPRODUCT(price,Volume)
Remember: ‘price’ is the named range for column A and ‘Volume’ is the named range for column D.
The beauty of the SUMPRODUCT in this calculation is you can achieve the same result in one cell that would otherwise take up a whole column.
Quick Recap on the Rules
In SUMPRODUCT functions you can employ the AND logic, and OR logic using the * and + symbol:
- When the multiplication symbol * is used it reads ‘AND’.
- When the plus symbol + is used it reads ‘OR’.
Tip: if your formula results in a zero and you know it should be >zero then you either have an error in your data, or you have an error in your formula.
P.S. If you’re wondering what the data is in the example, it’s a data dump from EVE which is a game Phil plays where he flies fantasy space ships in a fantasy galaxy, fighting fantasy baddies. Just goes to show some men never grow up!


... I would highly recommend My Online Training Hub for all your Microsoft Office needs .... Geniuses



{ 78 comments… read them below or add one }
Good website
Thanks Ash.
Thanks you made it easy to understand
Cheers, William L:)
Nice! Thanks for explaining it clearly
These things should be in excel help, they are very useful
Thanks, Vidak
Very helpful – I needed the datevalue part of the function.
thanks
Thanks, Dan. Glad to have helped
Now I know what I have using without understanding it.
Hi Mynda,
I wonder if it works when one of the criteria is Date (MM/DD/YYYY). I have been trying it, but could not succeed. For example,
Date Flower Number
2/1/2012 JASMINE 10
2/1/2012 ROSE 15
2/1/2012 LAVENDER 20
2/1/2012 LAVENDER 5
2/1/2012 ROSE 9
2/1/2012 JASMINE 15
2/2/2012 JASMINE 18
2/2/2012 JASMINE 12
2/2/2012 LAVENDER 22
2/2/2012 ROSE 55
2/2/2012 LAVENDER 12
2/2/2012 ROSE 69
2/2/2012 ROSE 80
Now, I want to know each type of flower sold in a particular date on another sheet. Please advise how can I do that. I believe this formulae does not work on Dates. I am required to play around. Please help.
Hi Atul,
It does work on dates, as you can see in my example above, but you need to wrap them in a DATEVALUE function, or use the date serial number, or reference a cell containing the date.
The format of the date i.e. dd/mm/yy or mm/dd/yy shouldn’t matter as Excel will automatically interpret it based on your Excel and system settings.
I suggest you download the workbook for the tutorial above and play around with the formula that uses dates to see if you can find where you’re going wrong.
Kind regards,
Mynda.
I am using the 2003 Excel and I am trying to use two criteria, and to add the numbers in a third column. Now I have use this method in another workbook and it worked. But with the other workbook, the criteria’s were looking for “X” in both and the adding the third column when it applied. With this new workbook, the criteria’s are both numbers, and then add from a third column. The formula wont work if both the criteria are numbers for some reason. Do you have any suggestions?
Hi Julie,
I’d need to see your formula to know what the problem might be.
Kind regards,
Mynda.
=SUMPRODUCT((ColI=”X”)*(TVCC=”X”)*Total) This is the formula that worked, I want the exact same thing but replace the “X”‘s with 5 to 9 digit numbers.
Thanks
Hi Julie,
If you replace the x’s with numbers then you don’t put them inside double quotes….unless of course they are text and not numbers. In which case you would put them inside double quotes.
Remember double quotes tell Excel the data is text not a value/number.
If you can’t get it to work you’ll need to send me the workbook so I can see the data you’re working with.
Kind regards,
Mynda.
That was it! Thank you very much Mynda, that was very helpful. I forgot about that rule with the quotes.
I really appreciate the quick responses aswell.
Best wishes,
Julie.
Very useful & easy to absorbe. cheers,
Cheers, Vaidehi
Issue:
=SUMPRODUCT((Volume)*((solarSystem=”Rens”)+(solarSystem=”Endrulf”))*(jumps=6))
This will over count if both conditions of your “or” are true. It should be
=SUMPRODUCT((Volume)*or((solarSystem=”Rens”),(solarSystem=”Endrulf”))*(jumps=6))
Hi Kenneth,
Thanks for your comment, but since Rens and Endrulf are in the same column (solarSystem) they can’t both be true at the same time therefore double counting in this instance isn’t a concern.
Also note; your formula evaluates to 654,429,777 which is the SUM of volume where Jumps = 6. It is ignoring the OR statement in the SUMPRODUCT.
Kind regards,
Mynda.
I don’t know if it’s just me, but I tried what you suggested and had an error but found out what was wrong. Instead of
=SUMPRODUCT((Volume)*((solarSystem=”Endrulf”)*(jumps=6)))
it should be
=SUMPRODUCT((Volume),((solarSystem=”Endrulf”)*(jumps=6)))
Use a comma instead of asterisk after the array you want to sum. Just FYI.
Hi Elton,
Thanks for your comment. Both methods give the same result for me.
Kind regards,
Mynda.
Hi,
While both formulas are valid, I’ve found that using Elton’s formula can be useful where the range you are summing contains text (e.g. headings). This can be useful when you are progressively adding to a dataset and so want to sum whole columns.
For example:
=SUMPRODUCT((D:D)*((G:G=”Endrulf”)*(H:H=6))) would result in a #VALUE! error due to text in the column headings
but
=SUMPRODUCT((D:D),((G:G=”Endrulf”)*(H:H=6))) will give you the correct result (being 44,463,091).
You need to have at least two arguments in the second array or the formula will return 0. If you only have 1, you can get around it by inserting 1* e.g.:
=SUMPRODUCT((D:D),1*(G:G=”Endrulf”))
however this is a bit of a kludge.
Anyways… that’s my two cents!
Cheers, Alison
i need to ask a question on this…
i have an excel sheet which contains my problem…how can i attach it…
Hi Nurzy,
You can send me files by logging a ticket on the help desk.
Kind regards,
Mynda.
Thanks for this. Now I understand well the power of SUMPRODUCT…
You’re welcome, Marlo
Hi Mynda,
Thanks Mynda for such a clear explanation of function.
kudos,excellent work
Thank you, Joseph
Hi,
Thanks for your detailed explanation however could you please send some more exercise to practice on
Thanks in advance.
Regards,
Vicky
Hi Vicky,
If you want to join my Excel course you receive Excel workbooks with homework questions for practice.
Kind regards,
Mynda.
Thank u, I was searching for this solution
Hi
Very well explained. i only use Excel once in a while, and many features get lost over time. So your kind of assistance is a great help, when need arise.
regards
Otto Nielsen
Denmark
PS: And I am human …I think
Thanks, a very informative explanation. One question, lets say I have to sum a range based on thee AND statements and one OR, for performance would it be better to use the SUMPRODUCT as you describe, or to add two SUMIFS?
Hi Peter,
I’d choose SUMPRODUCT, but if you feel more comfortable with the SUMIFS then go with that.
Kind regards,
Mynda.
Hi
I would like to calculate the sum of all values in a range which are NOT equal to the criteria of two values (each of which are in different ranges).
So the ranges are as below:
R1 R2
1 2
1 3
1 4
2 2
2 3
1 2
2 4
2 6
2 4
So, if the value in R1 is 1 and the value in R2 is 2 calculate the sum of the values remaining in R1.
So there are 2 rows where R1 is 1 and R2 is 2.
Adding up the remaining values in R1 gives a total of 12.
How do I calculate the answer 12?
Another example from the ranges above is
Calculate the sum of all values remaining in R1 after the following is met:
R1=1 and R2=2
AND
R1=2 and R2=4
Answer is 8
Many thanks for your help!!
Dear Justin,
Quite a brain twister you’ve got there. I don’t know why SumIF or SUmproduct alone won’t work using “<>“(not equal) conditions.
Instead of an “AND” effect, it is more like getting an “OR”
so I improvised: Note : Row1 and Row 2… columns A to I.
this will result to 12.
this will result to 8
I would like to point out in this second formula that you could have not meant AND It’s clear that it’s an OR
because you can’t have 4 conditions on two parallel cells being evaluated.
hence; OR(AND(r<>1,r<>2),AND(r<>2,r<>4). So it’s a plus(+) and not an asterisk(*)
I hope you’ll like it.
The logic is simple. I added first all in row 1. So the total is 14.
Then,
I used SUMIFS and SUMPRODUCT respectively to get the supposedly numbers to be excluded
and deducted it from the total.
Read more on SUMIFS and SUMPRODUCTS
Sincerely,
Carlo
Or you could use
=SUMPRODUCT(SIGN((A2:A10R1)+(B2:B10R2)),A2:A10)
Hi Minda,
Very nice and very useful.
Thank you very much for explication and for all hard work.
I wonder how can I implement a condition “like”. It is possible?
For example: =SUMPRODUCT((Volume)*(solarSystem like “E*”)*(jumps=6))
I discover another useful criteria; if you wont to skip some records:
=SUMPRODUCT((Volume)*(–ISERROR(SEARCH(“Rens”, solarSystem)))*(jumps=6))
In this example the sum skip the records “Rens”.
I hope this help.
Best regards,
Sorin.
Hi Sorin,
I never thought you were asking a question. Sorry.
Anyways, in a formula level I don’t think you can use ‘Like’ like
you can use an ‘And’ or an ‘Or’.
With you asking that, I suppose you know about programming like VBA.
Well, it’s where you can use the operator ‘LIKE’. However, in a formula level the
combination of an equal sign (=) and an asterisk (*), will give
you the effect of a like operator.
So why don’t you send your file and let us see what you want to do so we can
help via HELP DESK.
Cheers.
CarloE
Combine the LEFT function to get what you want
=SUMPRODUCT(–(LEFT(solarSystem,1)=”E”),–(jumps=6),volume)
Hi, Carlo.
Thank your for your answer.
I discover myself, today, the solution:
=SUMPRODUCT((Volume)*(ISNUMBER(SEARCH(“E”, LEFT(solarSystem, 1))))*(jumps=6))
But it is wrong this: =SUMPRODUCT((Volume)*(ISNUMBER(SEARCH(“E*”, solarSystem)))*(jumps=6)) because function ‘SEARCH’ search for character ‘E’ in all word, not begin with character ‘E’.
Can you explain me, please, why when evaluate, for example (jumps=6), sometimes return a list like {1,0,1,0…} and sometimes return a list like {TRUE, FALSE, TRUE, FALSE…}.
Thank you very mutch.
Sorry Mynda for ‘i’.
Best regards,
Sorin.
Hi Sorin,
Glad you found a solution. Well done
When SUMPRODUCT evaluates the jumps=6 criteria it returns an array of TRUE’s and FALSE’S. In Excel a TRUE = 1 and FALSE = 0. The multiplication before the argument *(jumps=6) coerces the series of TRUE’s and FALSE’s into 1′s and 0′s.
The multiplication does the same as the double unary in this formula –ISERROR(SEARCH(“Rens”, solarSystem)))
More on array formulas here.
I hope that helps.
Kind regards,
Mynda.
Hi Sorin,
Please send your file to HELP DESK so we can understand what you are trying to do.
My apologies I wasn’t thinking of a SEARCH function when I said you can use equal(=) and asterisk(*) to simulate a LIKE function in
programmming. Anyways, SEARCH function don’t need asterisk or any wildcard character like a question mark(?) for it to function as it does.
It’s like a ‘LIKE’ function only within a TEXT.
On this note, I am confused. Why would you want to simulate an “E*” wildcard search?
Are you trying to validate whether a word begins with a letter E?
You could just use LEFT(Word,1)= “E”.
perhaps a formula like this:
Anyway, I’m still not quite sure as to what you really want here. So might as well
send your file through HELP DESK.
Sincerely,
CarloE
Hi Mynda,
Thank you very much for explanations. This explain a lot.
Yes Carlo, it is very simple your solution, but some times we don’t find a easiest solutions.
I post the solution I was find, not best solution. Thank you for support.
Best regards,
Sorin
Hi Sorin,
On behalf of Mynda and Philip, you’re welcome.
Cheers.
Carlo
Hi thanks for the useful info above. I would be grateful if you could help me with my following query:
i have text name in Column A and i want to sumproduct values in column B & C with reference to specific names under Column A. Is this possible through sumproduct formula ?
Hi Gaurav,
Greetings.
Yes you can… very much.
Try this example.
Assume the data
A B C 1 Names Value1 Value2 2 Name1 10 10 3 Name2 20 20 4 Name3 30 30paste this formula anywhere in the sheet.
Please read more on SUMPRODUCT.
Cheers.
CarloE
Carloe…
I dont know how should i express my gratitude to you. The formula really works and this is a simple solution to my complex problem. I am amazed on how do you extend your support to someone, whom you dont even know!!! Thanks for your assistance, god bless you !
Regards
Gaurav Sahni, India
Hi Gaurav,
On behalf of Mynda and Philip, I say You’re Welcome!!!
It always feel good to have someone appreciate ones work too.
So thank you too.
Cheers.
CarloE
You don’t need to do the multiply in the formula, SUMPRODUCT does the multiply (PRODUCT), so you can use
=SUMPRODUCT(–(A2:A4=”Name1″),B2:B4,C2:C4)
which will also handle text values in the sum ranges as mentioned elsewhere.
Hi Mynda,
Wonderful explanation, thank you! I literally spent days searching for the right formula for my spreadsheet and this is the only site which made me understand why SUMPRODUCT would work, instead of copying/pasting formulas found online.
My formula doesn’t seem to be adding up properly though. I have the following:
Date Budget Amount
01/01/13 Stationery 12.00
02/01/13 Expenses 5.00
07/01/13 Entertainement 7.00
I want to see how much I’m spending per budget and per week (for instance Expenses from 1 Jan-7 Jan) so I used:
=SUMPRODUCT(amount,(budget=”Expenses”),(date>=DATEVALUE(“01/01/13″)),(date<=DATEVALUE("07/01/13"))) but I keep getting 0 instead of 5 as a result. Would you have any advice on what I'm doing wrong?
Hi Lisa,
Please use this formula.
=SUMPRODUCT((Amount)*((Budget="Expenses")*(AND(Date>=DATEVALUE("01/01/2013"),Date< =DATEVALUE("07/01/13")))))Assumptions: Named Ranges: Budget, Date and Amount
Read More: Sumproduct
Cheers.
CarloE
Ooops sorry something went wrong in my comment.
I meant to say I used the formula =SUMPRODUCT((amount)*((budget=”Expenses”)*(AND(date>=DATEVALUE(“01/01/13″); date=DATEVALUE(“01/01/2011″)*(Date<=DATEVALUE(“31/01/2011″))))?
Thanks again;
-Lisa
Hi Lisa,
I don’t know if it is already working or not, judging on how you wrote your feedback.
Anyway, Just send your concern via HELP DESK.
Cheers.
CarloE
Thanks Carlo, I send the details to the Helpdesk.
ARe you sure that formula works. I don’t think it does, because the AND will return a single TRUE/FALSE result, not an array of TRUE/FALSE that evaluates those date conditions.
This works perfectly fine
=SUMPRODUCT(–(Budget=”Expenses”),–(Date>=–(“2013-01-01″)),–(Date<=–("2013-07-01")),Amount)
I would also advise using this ISO standard date format to remove any ambiguity as to what the date being tested actually is (is 01/07/2013 7th Jan or 1st July?).
Hi,
I have a data where i have put the date like 01.02.2011,13.02.2012.
but when i am going to apply date formula then i am getting 01 and 13 as a month but i want 02 as a month so please give me a formula to apply here.
Hi Dusmanta,
I think all you need to do is to format your cells.
Right click the cells where your dates are and
1 Format Cells
2 This will bring you to the Number’s tab
3 Select Custom -> “mm/dd/yyyy”
Please read more on formatting cells.
Now you may not find an exact format :mm/dd/yyyy.
Just choose the closest or any custom date
format for that matter and manually edit the same
to mm/dd/yyyy.
Cheers.
CarloE
I’ve been playing with the fomula for a bit and kind of got it figured out but when I add more rows of data to imput it is not picking them up even though the data is in the ranges. On one worksheet is a log where I am entering the data as it comes in. On the next worksheet is a summary that spreads the data into groups that are easier to compare and figure out issues/problems. Right now my formula looks like this “=SUMPRODUCT((’2013 Crane Repair Log.xls’!Date>=B19)*(’2013 Crane Repair Log.xls’!Date<=C19)*('2013 Crane Repair Log.xls'!CraneNumber="15")*'2013 Crane Repair Log.xls'!Value)" Date CraneNumber and Value are all ranges I've created. Please help!
Hi Chris,
Try reading Array Formulas.
Or you might send your file to Help Desk.
Cheers.
CarloE
Or use dynamic named ranges.
Could you please help me? I have used SUMPRODUCT in a 2007 sheet as the file has to be used on a PC which has Excel 2003. However, I keep on getting the #NAME! error and, for the life of me, I can not see why. Are you able to see what is wrong with
=SUMPRODUCT((‘Referral Progress’!$D$1:$D$8197=’Area Overview’!$A4)*(‘Referral Progress’!$J$1:$J$8197>=’Area Overview’!K$1)*(‘Referral Progress’!$J$1:$J$8197<'Area Overview'!T$1))
Thank you in advance
Hi Seth,
I would like to inform you that I don’t have 2003 anymore.
However, Let’s see what we can do. Please send that file via HELP DESK.
Cheers,
CarloE
I have gone through your excel formula,and i found it is very useful tool .
Thanks, Gautam
truly a great lesson, I had a computer course and I also give lessons on excel, and this website provides the motivation for me. thank you for sharing. Greetings TCC Sampit.
You’re welcome, TCC Sampit
Can you also please demonstrate how can we use SUMPRODUCT for getting the top 5 with multiple critera’s for e.g.
I need to know the sum of the top 5 Volumes for SolarSystem ‘EndRulf’ and jumps = 6 (considering there are 2,3,4,5.. jumps)
Hi Acpt,
Like this:
Kind regards,
Mynda.
Hi Mynda,
Sorry I am late in the party, Thanks for making Sumproduct formula easy to understand.. till now i hv understood that we use ‘+’ sign as an OR and ‘*’ sign as an AND operator in Sumproduct formula.
I have seen many people use ‘- -’ in a sumproduct, will appreciate if you can explain the use and why it is used please ?
Thanks in advance
Pradeep
Hi Pradeep,
The double unary ‘- -’ is used to convert the boolean TRUE/FALSE to their numeric equivalents of 1 and 0.
Kind regards,
Mynda.
You’re welcome, Julie
Thanks for letting me know you sorted it out.