abberyfarm
Well-known Member
- Joined
- Aug 14, 2011
- Messages
- 733
Hi there,
I have acceleration for a car in a column, the values are positive and negative for acceleration and deceleration. I want to put a marker "1" in another column each time the sign changes, i.e the point when the car accelerates or decelerates.
I have a do loop set up below, but im not sure how to write the condition for "when the value of the sign changes"?
Would somebody be able to help me out?
Thanks
this is what the data looks like
I have acceleration for a car in a column, the values are positive and negative for acceleration and deceleration. I want to put a marker "1" in another column each time the sign changes, i.e the point when the car accelerates or decelerates.
I have a do loop set up below, but im not sure how to write the condition for "when the value of the sign changes"?
Would somebody be able to help me out?
Thanks
Code:
Do
If (ActiveCell.Offset(0, -11) = "sign changes") Then
ActiveCell.Value = 1
End If
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -1))
this is what the data looks like
Code:
0.00
0.44
0.44
0.64
0.75
0.86
0.87
0.87
0.43
0.43
0.06
-0.03
-0.17
-0.42
-0.42
-0.44
-1.36
-1.42
0.06
0.06
0.06
0.92
0.94
0.99
0.99
0.99
-0.08
-0.72
-0.47
Last edited: