+ Reply to Thread
Results 1 to 13 of 13

Linear Interpolation help

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    92

    Linear Interpolation help

    Hi Guys, look:

    Cells C3:C36 have a series of dates stretching forward in time
    Cells D3:D36 have a series of increasing values corresponding to those dates
    Cell A1 has a specific date.

    I would like an elegant way for the following: Scan the date range and find the 2 dates in between which my date falls, interpolate linearly using their corresponding values in column D so that I can get an interpolated value for my initial date. Thanks guys!

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

    Re: Linear Interpolation help

    Can you upload example workbook?
    Make sure to avoid personal informations.

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Linear Interpolation help

    Here you go Thanks!
    Attached Files Attached Files

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

    Re: Linear Interpolation help

    Where do you want output for your result?

  5. #5
    Registered User
    Join Date
    04-11-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Linear Interpolation help

    Anywhere is fine, say G5

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

    Re: Linear Interpolation help

    Try something like this:

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

  7. #7
    Registered User
    Join Date
    04-11-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Linear Interpolation help

    Unfortunately, this just calculates the midpoint between the values, but I need the interpolation. So that it is accurate on whichever date between.... Im not sure if I am explaining myself well....

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

    Re: Linear Interpolation help

    Linear interpolation of two points is midpoint.

  9. #9
    Registered User
    Join Date
    04-11-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Linear Interpolation help

    No. Linear interpolation is finding the straight line which connect two points. This line has an infinite number of y values for infinite number of x values.
    The linear interp of coordinates 0,0 and 2,2 is a straight line, and the value of the interpolation will depend on your x. If your x is close to 2, then your y will be close to 2.

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

    Re: Linear Interpolation help

    Sorry, I missunderstood...

    Does this help:

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

  11. #11
    Registered User
    Join Date
    04-11-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Linear Interpolation help

    However, this doesnt work when I try to put the formula in another worksheet, I use:

    =FORECAST(AY8,OFFSET('MID-SWAP Curve'!$C$2,MATCH(AY8,'MID-SWAP Curve'!$C$3:$C$36,1),1,2),OFFSET('MID-SWAP Curve'!$C$2,MATCH(AY8,'MID-SWAP Curve'!$C$3:$C$36,1),,2))

    Somehow the match function gives N/A

    Ideas?

  12. #12
    Registered User
    Join Date
    04-11-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    92

    Re: Linear Interpolation help

    It works! However, this doesnt work when I try to put the formula in another worksheet, I use:

    =FORECAST(AY8,OFFSET('MID-SWAP Curve'!$C$2,MATCH(AY8,'MID-SWAP Curve'!$C$3:$C$36,1),1,2),OFFSET('MID-SWAP Curve'!$C$2,MATCH(AY8,'MID-SWAP Curve'!$C$3:$C$36,1),,2))

    Somehow the match function gives N/A

    Ideas?

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

    Re: Linear Interpolation help

    Is your AY8 in same shwwt or in MID-SWAP sheet?

    Because this one works for me:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

+ 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. 2D linear interpolation
    By mochen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2012, 05:01 AM
  2. Linear Interpolation
    By mikethemonster in forum Excel General
    Replies: 0
    Last Post: 07-04-2011, 02:27 PM
  3. VBA Linear Interpolation
    By WAW in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-25-2010, 04:55 PM
  4. Linear Interpolation
    By Metalmaniac in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-03-2005, 10:05 AM
  5. [SOLVED] linear interpolation
    By Taha in forum Excel General
    Replies: 3
    Last Post: 01-31-2005, 11:06 AM

Tags for this Thread

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