Hi. The formula STDEV.P(B2:$B$22) calculates the standard deviation of the range b2:b22. This formula works great until row 21. The problem is that in row 22 I would like it to calculate the stdev of range (B22:$B$42) and not B22:B22.
Now, I will try to explain where B42 comes from. Column E has dates. Between E2 and E21 there is the same date. It changes in E22 and stays the same until E41. It changes again in E42. So every time the date in cell E changes I would like this to be the new end row of the range B2:$B$X, where X is the row that the date in cell E changes.
A table to understand. G is the end result
[TABLE="width: 500"]
<tbody>[TR]
[TD]row\column[/TD]
[TD]B[/TD]
[TD]E[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]11[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B2:$B$22)[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]12[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B3:$B$22)[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]10[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B4:$B$22)[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD]14/2/2006[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]13[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B21:$B$22)[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]14[/TD]
[TD]14/3/2006[/TD]
[TD]=STDEV.P(B22:$B$42)[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD]14/3/2006[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]41[/TD]
[TD]11[/TD]
[TD]14/3/2006[/TD]
[TD]=STDEV.P(B41:$B$42)[/TD]
[/TR]
[TR]
[TD]42[/TD]
[TD]10[/TD]
[TD]18/4/2006[/TD]
[TD]=STDEV.P(B42:$B$67)[/TD]
[/TR]
</tbody>[/TABLE]
G42 has $B$67 because in E67 the date is not 18/4/2006.
Hope you understand what I'm trying to do!
Thanks for any help!
Now, I will try to explain where B42 comes from. Column E has dates. Between E2 and E21 there is the same date. It changes in E22 and stays the same until E41. It changes again in E42. So every time the date in cell E changes I would like this to be the new end row of the range B2:$B$X, where X is the row that the date in cell E changes.
A table to understand. G is the end result
[TABLE="width: 500"]
<tbody>[TR]
[TD]row\column[/TD]
[TD]B[/TD]
[TD]E[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]11[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B2:$B$22)[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]12[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B3:$B$22)[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]10[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B4:$B$22)[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD]14/2/2006[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]21[/TD]
[TD]13[/TD]
[TD]14/2/2006[/TD]
[TD]=STDEV.P(B21:$B$22)[/TD]
[/TR]
[TR]
[TD]22[/TD]
[TD]14[/TD]
[TD]14/3/2006[/TD]
[TD]=STDEV.P(B22:$B$42)[/TD]
[/TR]
[TR]
[TD]...[/TD]
[TD][/TD]
[TD]14/3/2006[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]41[/TD]
[TD]11[/TD]
[TD]14/3/2006[/TD]
[TD]=STDEV.P(B41:$B$42)[/TD]
[/TR]
[TR]
[TD]42[/TD]
[TD]10[/TD]
[TD]18/4/2006[/TD]
[TD]=STDEV.P(B42:$B$67)[/TD]
[/TR]
</tbody>[/TABLE]
G42 has $B$67 because in E67 the date is not 18/4/2006.
Hope you understand what I'm trying to do!
Thanks for any help!
Last edited: