Difference between revisions of "Documentation/How Tos/Calc: SUMPRODUCT function"
From Apache OpenOffice Wiki
< Documentation | How Tos
m (→Example:) |
|||
Line 3: | Line 3: | ||
== SUMPRODUCT == | == SUMPRODUCT == | ||
Multiplies corresponding elements in the given ranges, and returns the sum of those products. | Multiplies corresponding elements in the given ranges, and returns the sum of those products. | ||
− | |||
=== Syntax: === | === Syntax: === | ||
<tt>'''SUMPRODUCT(range1; range2; ... range30)'''</tt> | <tt>'''SUMPRODUCT(range1; range2; ... range30)'''</tt> | ||
+ | : <tt>'''range1'''</tt> to <tt>'''range30'''</tt> are up to 30 ranges whose corresponding elements are to be multiplied. | ||
− | + | : You can use <tt>'''SUMPRODUCT'''</tt> to calculate the scalar product of two vectors. | |
− | + | ||
− | + | ||
− | You can use <tt>'''SUMPRODUCT'''</tt> to calculate the scalar product of two vectors | + | |
− | + | ||
− | + | ||
− | + | ||
+ | : <tt>'''SUMPRODUCT'''</tt> can also be used to sum cells where a specified condition is true - see '''[[Documentation/How_Tos/Conditional Counting and Summation|Conditional Counting and Summation]]'''. | ||
=== Example: === | === Example: === | ||
− | |||
− | |||
<tt>'''SUMPRODUCT(A1:B2; C1:D2)'''</tt> | <tt>'''SUMPRODUCT(A1:B2; C1:D2)'''</tt> | ||
:returns <tt>'''A1'''</tt>*<tt>'''C1'''</tt> + <tt>'''B1'''</tt>*<tt>'''D1'''</tt> + <tt>'''A2'''</tt>*<tt>'''C2'''</tt> + <tt>'''B2'''</tt>*<tt>'''D2'''</tt>: | :returns <tt>'''A1'''</tt>*<tt>'''C1'''</tt> + <tt>'''B1'''</tt>*<tt>'''D1'''</tt> + <tt>'''A2'''</tt>*<tt>'''C2'''</tt> + <tt>'''B2'''</tt>*<tt>'''D2'''</tt>: | ||
− | |||
::[[Image:Calc_sumproduct_example.png|Example use of SUMPRODUCT function]] | ::[[Image:Calc_sumproduct_example.png|Example use of SUMPRODUCT function]] | ||
Line 30: | Line 22: | ||
'''[[Documentation/How_Tos/Calc: SUMIF function|SUMIF function]]''', | '''[[Documentation/How_Tos/Calc: SUMIF function|SUMIF function]]''', | ||
'''[[Documentation/How_Tos/Calc: SUMSQ function|SUMSQ function]]''' | '''[[Documentation/How_Tos/Calc: SUMSQ function|SUMSQ function]]''' | ||
− | |||
'''[[Documentation/How_Tos/Conditional Counting and Summation|Conditional Counting and Summation]]''' | '''[[Documentation/How_Tos/Conditional Counting and Summation|Conditional Counting and Summation]]''' | ||
+ | |||
+ | '''[[Documentation/How_Tos/Calc: Array functions|Array functions]]''' |
Revision as of 09:43, 24 February 2008
SUMPRODUCT
Multiplies corresponding elements in the given ranges, and returns the sum of those products.
Syntax:
SUMPRODUCT(range1; range2; ... range30)
- range1 to range30 are up to 30 ranges whose corresponding elements are to be multiplied.
- You can use SUMPRODUCT to calculate the scalar product of two vectors.
- SUMPRODUCT can also be used to sum cells where a specified condition is true - see Conditional Counting and Summation.
Example:
SUMPRODUCT(A1:B2; C1:D2)
- returns A1*C1 + B1*D1 + A2*C2 + B2*D2:
See also:
SUM function, SUMIF function, SUMSQ function