Is this the actual calculation, or is this an attempt at something that you feel is representative? Some simple algebra on that expression should show you that sum(for i= 1 to n-1)(a(i+1)-a(i)) simplifies to a(n)-a(1) [50-10 in the example]. Assuming your example is representative, I would be tempted to do away with the UDF and do something like =INDEX($A$1:$A$11,COUNT($A$1:$A$11)-$A$1
Bookmarks