View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Understanding the objective '--' used in SUM PRODUCT function

The double unary is never "needed". Someone discovered that
it does the same thing as multiplying the arrays......


The double unary does *not* do the same thing as multiplying the arrays


Let me rephrase that, then:

The double unary is never "needed". Someone discovered that it has the same
net effect as multiplying the arrays......

Biff

"JE McGimpsey" wrote in message
...
The double unary does *not* do the same thing as multiplying the arrays,
and that is what likely leads to the increased efficiency.

When one uses the form

=SUMPRODUCT(arr1 * arr2)

the arrays are converted to numeric arrays, then multiplied, then the
result (a single array) is passed to the SUMPRODUCT function to be
summed.

When one uses the form

=SUMPRODUCT(--arr1,--arr2)

the arrays are converted to numeric arrays, then both arrays are passed
to SUMPRODUCT to be multiplied and summed.

The end result may be the same, but it would not be surprising that a
function optimized to multiply arrays would be somewhat more efficient
than the multiplication operator passed two arrays.

Not sure what you mean about Help - neither the unary minus nor the
multiplication operator are mentioned in Help's SUMPRODUCT topic, but
both are mentioned under Calculation operators.

In article ,
"T. Valko" wrote:

The double unary is never "needed". Someone discovered that it does the
same
thing as multiplying the arrays and is slightly more efficient. What does
Help say about the double unary?


It isn't even mentioned!