+ Reply to Thread
Results 1 to 10 of 10

Linear interpolation with unevenly spaced data

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    West Sussex, England
    MS-Off Ver
    Excel 2010
    Posts
    19

    Linear interpolation with unevenly spaced data

    Hi,

    I am trying to interpolate a data set to 1 second intervals. The original data set is unevenly spaced i.e. 1, 3, 5, 6, 8, 9 etc. I have attached an example data sheet.

    Column A = Time (s)
    Column B = Value

    Column D = Interpolation Time Value (i.e. 1 s intervals)
    Column E = Interpolated Value.

    If you could provide an excel equation for column E it would be much appreciated. Please feel free to edit the spreadsheet layout if this makes it easier.

    Interpolation Spreadsheet Example.xlsx

    Many thanks,

    Andy

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Linear interpolation with unevenly spaced data

    Here, try this:
    Attached Files Attached Files

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Linear interpolation with unevenly spaced data

    Put this in E3:

    =IF(ISNUMBER(MATCH(D3,A:A,0)),INDEX(B:B,MATCH(D3,A:A,0)),(INDEX(B:B,MATCH(D3,A:A))+INDEX(B:B,MATCH(D3,A:A)+1))/2)

    then copy down.

    Hope this helps.

    Pete

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Linear interpolation with unevenly spaced data

    Much simplier than mine but mine works for more than one missing value:

    Please Login or Register  to view this content.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,852

    Re: Linear interpolation with unevenly spaced data

    Yes, mine is just a straight average for the missing values, whereas yours seems to take a weighted average so gives a smoother transition.

    Pete

  6. #6
    Registered User
    Join Date
    11-13-2012
    Location
    West Sussex, England
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Linear interpolation with unevenly spaced data

    Hi Zbor and Pete,

    Thank you both for your response. Zbor, the equation works perfectly and will certainly save me plenty of time.

    I was wondering whether I could ask you if you could take a look at the new spreadsheet I have attached. It is the same as the initial one except I have added 13 extra columns that I would also like to be interpolated to 1 s values. I have included 4 columns with no data which I may add in later. If you could set the spreadsheet up so that whatever data is inserted into these additional columns is also interpolated that would be fantastic. I have tried to replicate the equation that you have included to the additional columns but have had no luck!

    Thank you again to both of you for your help on this.

    Much appreciated.

    Andy

    Interpolation Spreadsheet Example (1).xlsx

  7. #7
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,636

    Re: Linear interpolation with unevenly spaced data

    Try this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-13-2012
    Location
    West Sussex, England
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Linear interpolation with unevenly spaced data

    Excellent.

    Many thanks.

    Andy

  9. #9
    Registered User
    Join Date
    05-16-2021
    Location
    Brisbane
    MS-Off Ver
    365
    Posts
    1

    Re: Linear interpolation with unevenly spaced data

    Hi Zbor,

    I'm wondering if it is possible to get a copy of this spreadsheet - I'm looking to do a similar interpolation to some data and looking for examples?

    Thanks,
    Glenn

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,956

    Re: Linear interpolation with unevenly spaced data

    Quote Originally Posted by GMS01 View Post
    Hi Zbor,

    I'm wondering if it is possible to get a copy of this spreadsheet - I'm looking to do a similar interpolation to some data and looking for examples?

    Thanks,
    Glenn
    The file can be accessed by clicking on the file name in that post
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1