I noticed that this method can’t be used when we have missing data at the end of the main list.
The Length of data and dataNEW is not the same. Is there any way to use interpolation and extrapolation for a list simultaneously?
They are not the same because data is not passed to Interpolation. The Select eliminates NaN values including the last two. That accounts for the difference in length. Try the following and you will see a warning about extrapolation.