View Single Post
  #4   Report Post  
Bernd Plumhoff
 
Posts: n/a
Default

Hi Maarten,

Enter the UDF (user defined function)
Option Explicit

Function sumabsdiff(r1 As Range, r2 As Range) As Double
Dim i As Long
i = 1
Do While Not IsEmpty(r1.Value2(1, i))
sumabsdiff = sumabsdiff + Abs(r1.Value2(1, i) - r2.Value2(1, i))
i = i + 1
Loop
End Function

(push ALT + F11, insert a module and then paste the code)

Put ones into cells A513, B514, C515, etc.
Enter
=sumabsdiff(OFFSET($A$1,COLUMN()-1,0,1,256),OFFSET($A$1,ROW()-513,0,1,256))
into cells A514, A515:B515, A516:C516, ...

HTH,
Bernd