# Sum of differences

1. ## Sum of differences

Hello all,

Excuse me if I am in breach of any etiquette by posting this here (I am somewhat new to this site) -let me know if I am.

I have a question on summing absolute differences, I am looking for a slightly more elegant solution than the one I have currently

=SUM(ABS(C\$73-C\$72),ABS(C\$72-C\$71),ABS(C\$71-C\$70),ABS(C\$70-C\$69),.....

Please note, I'm not trying to sum absolute differences between each pair in the range, only differences between adjacent pairs

Any help/guidance much appreciated!
Thanks

2. ## Re: Sum of differences

Something like:

=SUMPRODUCT(--(ABS(C70:C73-C69:C72)))

3. ## Re: Sum of differences

It would help if we knew the full range but assuming say C50:C73 then

``Please Login or Register  to view this content.``
above assumes no non-numerics in the range - adjust as necessary.

4. ## Re: Sum of differences

Thank you very much for this. It looks like it's working perfectly.

May I ask what the double "--" is doing/

Thanks also to DonkeyOte - I do need the range to be adjustable, which is why I left the question open-ended, but it seems you have both come up with similar solutions, so thanks for the help

5. ## Re: Sum of differences

Actually, the -- is not needed here. It is usually used to coerce TRUE/FALSE results to 1s and 0s... It was an involuntary introduction that didn't change the result

#### Thread Information

##### Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1