Hi,
can someone provide a formula to calculate the average of difference between a set of numbers. e.g 1,3,5,7,9. ((1-3)+(3-5)+(5-7)+(7-9))/4. Thankyou
Hi,
can someone provide a formula to calculate the average of difference between a set of numbers. e.g 1,3,5,7,9. ((1-3)+(3-5)+(5-7)+(7-9))/4. Thankyou
So, basically, (1-9)/4, for your example above? All of the numbers between the first and the last cancel out.
How dynamic does this need to be? The simplest is if the numbers are listed from A1:A5, then
=(A1-A5)/4
Pauley
--------
If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).
what about for a random series like this 19,23,43,54,20,13,19? i want to calculate the average change between numbers from left to right.
Try this..
Assuming the source range is A1:A5
Formula:![]()
Please Login or Register to view this content.
This will do...
Regards,
Vikas Gautam
Excel-buzz.blogspot.com
Excel is not a matter of Experience, its a matter of Application.
Say Thanks, Click * Add Reputation
if the datas are in A1 to G1 try
Formula:![]()
Please Login or Register to view this content.
☚ Click ★ just below left if it helps, Boo?ath?![]()
For another approach, a little algebra will show that the average of the differences is the same as the difference of the averages:
((1-3)+(3-5)+(5-7)+(7-9))/4 -> (1+3+5+7)/4-(3+5+7+9)/4 -> =average(set1)-average(set2)
Originally Posted by shg
It doesn't matter that your series is random or not. Mathematically-speaking, performing:
=AVERAGE(x1-x2,x2-x3,x3-x4,...,xn-1-xn)
is identical to performing:
(x1-xn)/(n-1)
as Pauleyb points out.
Or, in Excel terms, the array formula**:
=AVERAGE(A1:A5-A2:A6)
is identical to the non-array:
=(A1-A6)/(COUNT(A1:A6)-1)
Regards
Last edited by XOR LX; 09-25-2014 at 02:36 AM.
Always enjoy a good math discussion. If @avinkris knows the amount of measurements and the quantity of measurements is always the same, then I think we all agree that
(First Measurement - Last Measurement)/(Number of Measurements - 1)
is the simplest solution, and then 'hard coding' it to something like
=(A5-A1)/4
No need for arrays.
So, I wanted to know whether or not the number of measurements is dynamic. Here is my solution assuming the list starts in A1 and then goes across row 1:
=(A1-INDEX(1:1,,MATCH(1E+99,1:1,1)))/(MATCH(1E+99,1:1,1)-1)
Could use COUNT instead of MATCH, but the MATCH will ignore any blank cells between A1 and the last number (assuming that is a possibility).
Any thoughts to improve? Maybe determining where the start of the numbers are (e.g. A1 is blank and the numbers start in A2?).
Last edited by Pauleyb; 09-25-2014 at 10:51 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks