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

Author Message
vhhawk
Newbie

Joined: 17 May 2012
Posts: 1

Posted: Thu May 17, 2012 9:49 am    Post subject: Sum of absolute values of differences

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.

Vic
karolus

Joined: 22 Jun 2011
Posts: 208

Posted: Thu May 17, 2012 10:58 am    Post subject:

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
JohnV

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

 Posted: Thu May 17, 2012 12:50 pm    Post subject: 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.
keme
Moderator

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

Posted: Tue May 22, 2012 2:42 am    Post subject:

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)
 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