| View previous topic :: View next topic |
| 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 |
|
| Back to top |
|
 |
karolus OOo Advocate

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 |
|
| Back to top |
|
 |
JohnV Administrator

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. |
|
| Back to top |
|
 |
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) |
|
| Back to top |
|
 |
|