Wilco()
Member
I have found an exercise where sumproduct needs to be used. I noticed different ways of using the sumproduct(), but I do not understand where the * or the -- are used for. Or what they mean. I also do not know if there are other options(?) which can be used.
The aim of the exercise was to put the positive numbers in one column. And the negative in the other. Checking which product was related to what number.
The solution to the excercise:
=SUMPRODUCT(($G$5:$G$17=$J5)*($H$5:$H$17>0)*($H$5:$H$17))
=SUMPRODUCT(($G$5:$G$17=$J5)*($H$5:$H$17<0)*($H$5:$H$17))
My answer:
=SUMPRODUCT(--($G$5:$G$17=$J5);--($H$5:$H$17>0);$H$5:$H$17)
=SUMPRODUCT(--($G$5:$G$17=$J5);--($H$5:$H$17<0);$H$5:$H$17)
Can somebody explain the use of -- and * (and possible other options)?
The aim of the exercise was to put the positive numbers in one column. And the negative in the other. Checking which product was related to what number.
The solution to the excercise:
=SUMPRODUCT(($G$5:$G$17=$J5)*($H$5:$H$17>0)*($H$5:$H$17))
=SUMPRODUCT(($G$5:$G$17=$J5)*($H$5:$H$17<0)*($H$5:$H$17))
My answer:
=SUMPRODUCT(--($G$5:$G$17=$J5);--($H$5:$H$17>0);$H$5:$H$17)
=SUMPRODUCT(--($G$5:$G$17=$J5);--($H$5:$H$17<0);$H$5:$H$17)
Can somebody explain the use of -- and * (and possible other options)?