In another forum that cannot be named, I happened upon this almost 4 year old discussion about SUMPRODUCT. I almost put it in the joke thread, but reconsidered.
The insiders here will hopefully enjoy the tit for tat, especially when they recognise the key ("tosh") poster's identity. Enjoy
**************************************************
Author: P***, Date: 09.07.2006 at 11:32AM PDT
Title: And again SUMPRODUCT Problems...
Question: Dear Experts,
Something basic I still did not understand using the SUMPRODUCT Formula.....
I'm using this formula and the result is 0, although it shouldn't. What is wrong?
If the first condition is true and if the second condition is true and if the third condition is true, I would like to have a number as a result telling me that in the month September in cell Statistics!$B$5 the car "Sprinter" in cell "Statistics!$A7" was 3 times at the location "Car-Wash-Alarm-Neste".
thanks for help
regards
Nils
=SUMPRODUCT((Entry!$B$6:$B$994=Statistics!$B$5),(Entry!$G$6:$G$994="Statistics!$A7"),(Entry!$D$6:$D$994="Car-Wash-Alarm-Neste"))
------------------------------------------------------------------------
Author: m***, Date: 09.07.2006 at 11:35AM PDT
m***:
Nils,
Remove the quotes around "Statistics!$a7", it is looking for that as a literal string instead of the contents of that cell.
Matt
------------------------------------------------------------------------
Author: patrick***, Date: 09.07.2006 at 12:22PM PDT
Nils,
Try:
=SUMPRODUCT((Entry!$B$6:$B$994=Statistics!$B$5)*(Entry!$G$6:$G$994="Statistics!$A7")*(Entry!$D$6:$D$994="Car-Wash-Alarm-Neste"))
Patrick
------------------------------------------------------------------------
ID:17474630 Author: L***, Date: 09.07.2006 at 01:52PM PDT
Nils:
Matt noticed the quotes and Patrick added the asterix. The result of both solutions comes to.
=SUMPRODUCT((Entry!$B$6:$B$994=Statistics!$B$5)*(Entry!$G$6:$G$994=Statistics!$A7)*(Entry!$D$6:$D$994="Car-Wash-Alarm-Neste"))
Jaes
------------------------------------------------------------------------
Author: g***, Date: 09.08.2006 at 01:44AM PDT
g***:
I'm pretty sure you don't need the multiplication operators (alos known as *). Just removing the quotes should do it.
------------------------------------------------------------------------
Author: L***, Date: 09.08.2006 at 08:20AM PDT
gbentley:
Hmmm, I always use them.
Jaes
------------------------------------------------------------------------
Author: BobP, Date: 09.08.2006 at 09:25AM PDT
g***:
Some sort of operator to coerce the conditional tests to a numeric that SUMPRODUCT can work on is absolutely necessary. It doesn't have to be *, it could be ---, +0,^1,*1 or whatever, but you can't just ditch tehm.
------------------------------------------------------------------------
Author: patrick***, Date: 09.08.2006 at 01:10PM PDT
g***:
SUMPRODUCT works by evaluating each test in turn. If the test is true then the value of that test is 1 if not true the value of that test is zero. SUMPRODUCT then multiplies (if * is used) the results of the tests together and sums the total of the results. Thus if one of the tests is untrue then the value or all the tests on that row is zero and so nothing is added to the total.
If you are using SUMPRODUCT just to multiply arrays together then only a comma is Ok but if you want to have multiple tests then the results of those tests must be multiplied together - thus the need for the * between each test.
In other words it all depends on how you are using SUMPRODUCT.
Patrick
------------------------------------------------------------------------
Author: L***, Date: 09.08.2006 at 02:15PM PDT
Patrick:
Thank you for that quite excellent explanation. I wondered how it worked. That makes perfect sense.
Jaes
------------------------------------------------------------------------
Author: BobP, Date: 09.08.2006 at 05:00PM PDT
Sorry patrick***, but that is tosh.
If the test is true, then the result is not 1 but TRUe, if it is not, the result is FALSE. And there is not absolute need for multiplying because that is exactly what the PROFDUCT part of SUMPRODUCT part does. The necessity of some mathematical operator is to coerce the array of TRUE/FALSE values that are returned from the c onditional tests to an array of 1/0 values, that CAN be multiplied and summed.
If you want a proper explanation of the evolved use of SUMPRODUCT, see http://www.xldynamic.com/source/xld.SUMPRODUCT.html for a detailed explanation.
------------------------------------------------------------------------
Author: m*** Date: 09.08.2006 at 05:11PM PDT
Bob,
My train of thought: "Hey this guy is linking to xldynamic, I wonder if Bob knows about this. Wait a minute ..." I saw your username earlier but as Bob isnt a very uncommon name I didn't think to put 2 and 2 together as to who you were (I do seem to remember seeing you in a question a while back -- after looking I see it was one of Joanne's questions). Is this cross posted somewhere? In any case, welcome back!
Matt
------------------------------------------------------------------------
Author: BobP, Date: 09.08.2006 at 05:15PM PDT
Hi Matt,
I had almost forgotten this place, drawn back by a other post I saw somewhere else. Not my favourite forum as it is web based, and I am drawn to UseNet like a moth to a flame :-).
Hey, and congrats on the Cell Master.
Regards
Bob
------------------------------------------------------------------------
Author: patrick***, Date: 09.09.2006 at 12:31AM PDT
BobP,
It's sad that you clearly have little idea how a computer works. If someting is TRUE then it is treated a being equal to 1 and zero if it is false. Computers only work with zeros and 1s - nothing else.
Equally, you have not bothered to try out SUMPRODUCT with conditional tests using just commas as the separators. I have and it does not work. Other operators are needed to make it work.
So may I say that your dismissal of some simple experience and knowledge is misplaced and simply discourteous. I suggest that you have a look at this link for more on SUMPRODUCT:
http://www.vbaexpress.com/forum/showthread.php?t=1317
It's back to the drawing baorad for you I'm afraid.
Patrick
------------------------------------------------------------------------
Author: patrick***, Date: 09.09.2006 at 12:36AM PDT
BobP,
And from the site that you quote but obviously haven't read it says:
"But as this page is about SUMPRODUCT, you would expect that we could use that function in this case, and we can. The solution for the number of Fords sold in June using this function is
=SUMPRODUCT((A1:A10="Ford")*(B1:B10="June")).
The value is obtained with
=SUMPRODUCT((A1:A10="Ford")*(B1:B10="June")*(C1:C10))
Good luck.
Patrick
------------------------------------------------------------------------
Bookmarks