“Create” a VBA formula that will operate like =LOOKUP and will do a basic interpolation. The formula should be =INTERPOLATE(lookup value, x range, y range). For example, given the below data set:
|Pizzas||Ounces of Cheese Required|
The value of 35 interpolated in the above data would be 115. This should be a strict linear interpolation, not a cubic spline.
Also, for this assignment, although you are welcome to try to write an interpolation function. However, if you’d prefer not to reinvent the wheel, please search the internet for one that has already been written. Create a comment at the top of the code to identify where you pulled it from and who the original author was. Then prove to yourself that the code works as you expect.
One way to test your new function is to compare it to the Yield Curve for US Treasuries. What was average the interpolated yield on 15 year treasury bonds for yesterday, according the data provided at the website of the Treasury Department? Does the formula return what you would otherwise expect?
Turn in both your code and your “proof”.