OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

=SUM( A1:A10 * B1:B10 ) ?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
__fastcall
Newbie
Newbie


Joined: 25 Jul 2009
Posts: 2

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

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?
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Sat Jul 25, 2009 12:40 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
hotpepper
Power User
Power User


Joined: 04 Dec 2008
Posts: 52

PostPosted: Sat Jul 25, 2009 1:14 pm    Post subject: Reply with quote

What you want is SUMPRODUCT:

=SUMPRODUCT(A1:A10;B1:B10)
Back to top
View user's profile Send private message
__fastcall
Newbie
Newbie


Joined: 25 Jul 2009
Posts: 2

PostPosted: Sat Jul 25, 2009 2:22 pm    Post subject: Reply with quote

Villeroy:
Yeah, that's what I'm currently using.

hotpepper:
Thanks, that's what I'm looking for at the moment.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group