+ Reply to Thread
Results 1 to 10 of 10

Bilinear interpolation from a continuous Z = f(X,Y) data series

  1. #1
    Registered User
    Join Date
    04-15-2019
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    39

    Bilinear interpolation from a continuous Z = f(X,Y) data series

    Hello.

    I'd like to have some clue if a VBA code is available for bilinear interpolation of a continuous list; ie. given a continuous (not surface table) list of X, Y, and Z = f(X,Y) data, I would then be able to interpolate if I input a value of X and Y.

    The closest thing that I found in the forums related to my problem is this:
    www(dot)excelforum.com/excel-general/794506-3d-interpolation-for-surface-chart.html

    Your help is greatly appreciated. Thanks!

  2. #2
    Forum Contributor
    Join Date
    02-09-2009
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    380

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    Let me guess, survey data?

    I don't think anything's out there to download but I'd say you could knock something up with vba.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    No VBA used in this one: https://www.excelforum.com/excel-gen...ml#post4300787
    nor this one: https://www.excelforum.com/excel-for...ml#post4757864
    See if either of those will help you put together a bilinear interpolation algorithm for your data.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  4. #4
    Registered User
    Join Date
    04-15-2019
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    39

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    Hi, thanks for replying.

    Actually I am quite able to do those things already. I have a long list of X, Y, and Z data (not tabular as with the common bilinear Excel schemes) and I need to interpolate those points.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    That would seem very similar to the scenario described in the first link I gave, where the OP had a list of X, Y, Z data. As noted there, I suggested that the first step is to convert from a list to a table using a pivot table or similar. Are you saying that you are not allowed to change the data arrangement -- that you must perform the interpolation on the list arranged data? I have said elsewhere that the lookup step is the most difficult part of an interpolation algorithm in Excel. With bilinear interpolation, I find that the lookup step is even more difficult if the data are in a list. I would want to be sure that arranging the data in a table is absolutely forbidden before trying it.

  6. #6
    Registered User
    Join Date
    04-15-2019
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    39

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    Yeah, it would be strongly preferred to not rearrange the data. Is this even possible?

    What I see is that people do this so-called 'nearest neighbor algorithm' instead on the datasets

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    Possible? I am confident that it is possible. As I noted, a lot of the difficulty in interpolation algorithms is the lookup step. With bilinear interpolation, you need to find 4 adjacent points. With your data in a list like you describe, it is more difficult to find the four adjacent points. Why do you prefer not to rearrange the data? I have always felt that it was so much easier to rearrange the data that I have never really tried while keeping the data in a list. Do you have a sample data set for testing?

    A Nearest neighbor algorithm would be significantly easier.With a nearest neighbor algorithm, you need only find one point. Again, I think this is easier if the data are in a table rather than a list. With the data in a list, I envision either a two step pair of lookup functions or combine the x&y data into a helper column in a way that I can use the helper column to find the "nearest" x,y,z point.

  8. #8
    Registered User
    Join Date
    02-25-2021
    Location
    Canada
    MS-Off Ver
    MS Office 2013
    Posts
    2

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    Hi ice00monster,

    I see this is a old thread, and I was not completely happy with the solutions given as they used multiple cells or VBA. So I figured I'd post my solution here, does the bilinear interpolation in a single cell and doesn't need VBA.

    The formula in cell C18 of attached image here: =(TREND(OFFSET($C$6:$G$10,MATCH($B18,$B$6:$B$10,1)-1,MATCH(C$17,$C$5:$G$5,1)-1,2,1),OFFSET($B$6:$B$10,MATCH($B18,$B$6:$B$10,1)-1,0,2,1),$B18,TRUE)*(OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1),1,1)-C$17)+TREND(OFFSET($C$6:$G$10,MATCH($B18,$B$6:$B$10,1)-1,MATCH(C$17,$C$5:$G$5,1),2,1),OFFSET($B$6:$B$10,MATCH($B18,$B$6:$B$10,1)-1,0,2,1),$B18,TRUE)*(C$17-OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1)-1,1,1)))/(OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1),1,1)-OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1)-1,1,1))

    Attachment 720759

  9. #9
    Registered User
    Join Date
    04-15-2019
    Location
    Manila, Philippines
    MS-Off Ver
    2016
    Posts
    39

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    Quote Originally Posted by AJMACENG View Post
    Hi ice00monster,

    I see this is a old thread, and I was not completely happy with the solutions given as they used multiple cells or VBA. So I figured I'd post my solution here, does the bilinear interpolation in a single cell and doesn't need VBA.

    The formula in cell C18 of attached image here: =(TREND(OFFSET($C$6:$G$10,MATCH($B18,$B$6:$B$10,1)-1,MATCH(C$17,$C$5:$G$5,1)-1,2,1),OFFSET($B$6:$B$10,MATCH($B18,$B$6:$B$10,1)-1,0,2,1),$B18,TRUE)*(OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1),1,1)-C$17)+TREND(OFFSET($C$6:$G$10,MATCH($B18,$B$6:$B$10,1)-1,MATCH(C$17,$C$5:$G$5,1),2,1),OFFSET($B$6:$B$10,MATCH($B18,$B$6:$B$10,1)-1,0,2,1),$B18,TRUE)*(C$17-OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1)-1,1,1)))/(OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1),1,1)-OFFSET($C$5:$G$5,0,MATCH(C$17,$C$5:$G$5,1)-1,1,1))

    Attachment 720759

    Hi!

    Thanks for replying. I actually am still using such formulae in my studies, and I would be interested in seeing how yours work. Though it would be helpful if you attach a spreadsheet file, the attachment in your post does not seem to work

  10. #10
    Registered User
    Join Date
    02-25-2021
    Location
    Canada
    MS-Off Ver
    MS Office 2013
    Posts
    2

    Re: Bilinear interpolation from a continuous Z = f(X,Y) data series

    Hi in re-reading this, I see you were looking for all data in a single column, so this might not be what you'd need.
    However I think you can reorganize that the formula so that horizontal look-up is vertical, as long as data is sorted in increasing order and grouped by x, and y.

    Here's the spreadsheet link (hopefully). www(dot)excelforum(dot)com/attachment.php?attachmentid=720929&stc=1&d=1614371500

    In fact, it doesn't seem to hard to take it one step further and look up between tables f(x,y,z)

    Hope this helps. First time posting on a forum.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] inverse bilinear interpolation
    By rommie in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-16-2016, 08:48 AM
  2. Help with percentile functions or bilinear interpolation
    By miyaraj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-10-2016, 09:44 AM
  3. [SOLVED] Bilinear Interpolation VBA function for range
    By rajsh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2015, 07:52 AM
  4. Need help: VLookup/Index: Tricky Bilinear interpolation
    By rajsh in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-04-2015, 10:54 AM
  5. [SOLVED] Bilinear Interpolation- help needed
    By rajsh in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-28-2015, 05:29 AM
  6. Bilinear interpolation of scattered data points
    By Sebi in forum Excel General
    Replies: 15
    Last Post: 09-19-2012, 01:05 AM
  7. Bilinear interpolation of irregular grid
    By Sebi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-15-2012, 05:19 PM

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