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 of absolute values of differences

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


Joined: 17 May 2012
Posts: 1

PostPosted: Thu May 17, 2012 9:49 am    Post subject: Sum of absolute values of differences Reply with quote

Greetings,

I have a reference row of data. Each subsequent row has slightly different data values. I am trying to sum up the absolute values of differences to the reference row. It seems like it should conceptually be easy to do, but I can't figure out how to get SUM and ABS to work together over a range of data.

Row 1 is the reference row. My data columns begin at A and end at BS.

Code:
=SUM{ABS(A2-A1):ABS(BS2-BS1)}


would seem to be the ticket but throws a 512 error (which I also don't understand). I appreciate the help. I've been staring at this for an hour and I'm cross-eyed. Smile

Vic
Back to top
View user's profile Send private message
karolus
OOo Advocate
OOo Advocate


Joined: 22 Jun 2011
Posts: 208

PostPosted: Thu May 17, 2012 10:58 am    Post subject: Reply with quote

Hi
May be you search for:

Code:
=SUM(ABS((A2:BS2)-(A1:BS1)))

entered as Matrixformula (strg-shift-enter or [x]Matrix-option in Formulawizard )

Karo
Back to top
View user's profile Send private message
JohnV
Administrator
Administrator


Joined: 07 Mar 2003
Posts: 8979
Location: Lexinton, Kentucky, USA

PostPosted: Thu May 17, 2012 12:50 pm    Post subject: Reply with quote

I row 1 i have 10,9,8,7.
In row 2 I have 1,2,3,4.
=ABS(SUM(A2:D2)-SUM(A1:D1)) yields 24.
Back to top
View user's profile Send private message
keme
Moderator
Moderator


Joined: 30 Aug 2004
Posts: 2732
Location: Egersund, Norway

PostPosted: Tue May 22, 2012 2:42 am    Post subject: Reply with quote

Also, to facilitate copying that formula to the next row, you should have absolute addressing for the reference row. Modified Karolus' suggestion:
Code:
=SUM(ABS(A2:BS2-$A$1:$BS$1))

(Still needs to be entered as a matrix - or "array" - formula)
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