[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
__fastcall
Newbie

Joined: 25 Jul 2009
Posts: 2

Posted: Sat Jul 25, 2009 11:51 am    Post subject: =SUM( A1:A10 * B1:B10 ) ?

Is there a formula to calculate the sum of the products of each row in two columns?

e.g:

 Code: =SUM( A1:\$A10 * B1:\$B10 )

The problem is easily fixed by using: =SUM( A1*B1; A2*B2; A3*B3; A4*B4; ... )
Unfortunately it's not what I'm looking for...

Any suggestions?
Villeroy
Super User

Joined: 04 Oct 2004
Posts: 10106
Location: Germany

 Posted: Sat Jul 25, 2009 12:40 pm    Post subject: Solution in scalar context: X1=A1*B1 copy down X1 until X10 and get the sum of X1:X10. Your formula works as as a single formula in array context. Just finish the input with Ctrl+Shift+Enter rather than Enter. http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Using_Arrays_________________Rest in peace, oooforum.org Get help on https://forum.openoffice.org
hotpepper
Power User

Joined: 04 Dec 2008
Posts: 52

 Posted: Sat Jul 25, 2009 1:14 pm    Post subject: What you want is SUMPRODUCT: =SUMPRODUCT(A1:A10;B1:B10)
__fastcall
Newbie

Joined: 25 Jul 2009
Posts: 2

 Posted: Sat Jul 25, 2009 2:22 pm    Post subject: Villeroy: Yeah, that's what I'm currently using. hotpepper: Thanks, that's what I'm looking for at the moment.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum