Difference between revisions of "Documentation/How Tos/Calc: SUMPRODUCT function"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Initial content)
 
m
Line 19: Line 19:
 
=== Example: ===
 
=== Example: ===
  
<tt>'''=SUMPRODUCT(A1:B3; C1:D3)'''</tt>  
+
<tt>'''SUMPRODUCT(A1:B3; C1:D3)'''</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> + <tt>'''A3'''</tt>*<tt>'''C3'''</tt> + <tt>'''B3'''</tt>*<tt>'''D3'''</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> + <tt>'''A3'''</tt>*<tt>'''C3'''</tt> + <tt>'''B3'''</tt>*<tt>'''D3'''</tt>
  

Revision as of 22:04, 30 November 2007


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:B3; C1:D3)

returns A1*C1 + B1*D1 + A2*C2 + B2*D2 + A3*C3 + B3*D3


See also:

SUM function, SUMIF function, SUMSQ function


Conditional Counting and Summation

Personal tools