Hi there,
I'm trying to get the standard deviation of acceleration and deceleration of a range of cells. However, I keep getting the same result for both. I filter the cells in the range each time to display positive and negative values respectively. However, what can happen is that in the range the car might only be accelerating (or decelerating) the there will be no deceleration values (or acceleration values). In that case it should return the #DIV/0! error but it it is not.
Any ideas what is happening?
thanks
I'm trying to get the standard deviation of acceleration and deceleration of a range of cells. However, I keep getting the same result for both. I filter the cells in the range each time to display positive and negative values respectively. However, what can happen is that in the range the car might only be accelerating (or decelerating) the there will be no deceleration values (or acceleration values). In that case it should return the #DIV/0! error but it it is not.
Any ideas what is happening?
thanks
Code:
''Standard deviation Acceleration
Worksheets("raw").Select
With ActiveSheet
.AutoFilterMode = False
.Range("a1:j1").AutoFilter
.Range("a1:j1").AutoFilter field:=7, Criteria1:=">0" 'only display cases of acc
End With
StandardDevAcc = Application.StDev(Worksheets("raw").Range(Cells(sp, 7), Cells(ep, 7)))
Worksheets("kinematic").Activate
ActiveCell.Offset(0, 16).Value = StandardDevAcc
'Standard deviation Deccceleration
Worksheets("raw").Select
With ActiveSheet
.AutoFilterMode = False
.Range("a1:j1").AutoFilter
.Range("a1:j1").AutoFilter field:=7, Criteria1:="<0" 'only display cases of deacc
End With
StandardDevDeacc = Application.StDev(Worksheets("raw").Range(Cells(sp, 7), Cells(ep, 7)))
Worksheets("kinematic").Activate
ActiveCell.Offset(0, 17).Value = StandardDevDeacc