I log many engine parameters on my track car from the aftermarket ECU. After logging to a .csv I run a macro which converts some same data into useful information, ie lattitude and longitude.
The processed .csv is then used for a graphic overlay of speed, rpm, gear, throttle, brake pressure etc on my videos.
The ECU calculates which GEAR I`m in on the fly by comparing rpm and rotation of the driveshaft which it compares to a table in the ECU. I can't log gear-shaft so am unable to carry out the same calculation afterwards which would probably make life easier.
The displayed GEAR is fine for 99% of the time, but when I change gear I get several incorrect gear values. I believe this is due to the fact the clutch is still being re-engaged and the engine RPM vs driveshaft calculation 'thinks' I'm in a lower gear until the clutch is fuly engaged and the rpm vs output matches what I expect in the table.
The datalogs are usually over 50,000 lines long.
At the moment I go through the table looking for gearchanges and manually changing the 2, 3 or 4 consecutive incorrect cells.
My question is, is there some way of comparing the cells either side of the current gear value in the same column and then correcting the 'spurious' gear value. When looking at it by eye it's immediately obvious, but I don't know how to even start doing this in VBA