Showing results for 
Search instead for 
Did you mean: 

Interpolation of missing data in a column using previous and next point

Go to solution

I am receiving excel tables with an undefined number of rows and columns with every column, excluding the first, containing missing data values. I would like to loop each column (starting with the second) and linearly interpolate each missing value based only on the most recent value and the next available value. This VI must be able to handle multiple missing data points in a row. 


Is there any efficient built-in VIs to accomplish this task? I have looked into the 1d interpolate vi, but it does not seem to perform in the way that I would like.


Attached is a snippet of what an excel table might look like. 

0 Kudos
Message 1 of 4

LabVIEW does not have an out-of-the-box way to do this easily. You will need to implement the looping to apply the interpolate functions.


Pandas library in Python has an easy way to do this.

Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4

That seems like a trivial task and all you need to do is write code that handles one column, then iterate over all columns.


You said that the first column does not have missing values, but that's not true for your datafile. Is the first column the x-value for all columns? Can you attach a datafile that follows your description?


What should be done with the columns that don't have a first point and linear interpolation is not possible there.

0 Kudos
Message 3 of 4
Accepted by topic author PrimeEchoz

Here is a quick example. It will pad early and late missing points with the closest.


(I exported the excel file as text. and we need to read it as tab delimited array of strings to be able to distinguish an empty string from a true numeric zero).







  • The outer loop iterates over all columns
  • For each column
    • the first inner loop creates an array of valid points, (a "point" is a cluster of index and value, skipping all empty strings via conditional tunnel)
    • the second inner loop uses the valid array of points and creates interpolated values for each array index.


Message 4 of 4