It's normal because the code has no error detections!

It search for the speed bigger then 2000 and there is not one! so it calculates on an error.

It needs more fine tuning!

This code was so complex because the values for speed where not linear ! (error in the valus ??)

If it's all linear than the code is even simple : only need 8 values and no search for bigger speed.

But this was only the first step in solving the problem.

If all the functions are linear than the solution is even simple.

It only needs 8 values to enter to calculate all the values (interpolated or extrapolated ).

From the 8 given values we can calculate the Slope and the y-intersect for a speed.

Once we have the function we can calculate the mass for any temp.

Attached is an demo in VB6.

I have pre-entered the first values for speed 1000 and 1200 but it can be any value for any speed.

Enter them in the green and bleu textboxes and the speed and temp to calculate in the red textboxes.

Click on "Calc" to calculate the Mass (=red).

Do you want the solution in Excel or in VB6 ?