Interpolation of an xy table

trent172

New Member
Joined
Jun 4, 2012
Messages
15
Hi All,

Looking for a formula to work out the exact amount to be charged in the below cost table

300350400450500550600
11%¥1,872¥2,163¥2,448¥2,727¥3,000¥3,267¥3,528
12%¥1,733¥2,002¥2,266¥2,525¥2,777¥3,025¥3,266
13%¥1,616¥1,867¥2,113¥2,353¥2,589¥2,820¥3,045
14%¥1,515¥1,750¥1,981¥2,207¥2,428¥2,644¥2,855
15%¥1,428¥1,650¥1,867¥2,080¥2,288¥2,492¥2,691
16%¥1,351¥1,561¥1,767¥1,968¥2,166¥2,358¥2,547
17%¥1,284¥1,483¥1,679¥1,870¥2,058¥2,241¥2,420
18%¥1,224¥1,414¥1,601¥1,783¥1,962¥2,136¥2,307

<tbody>
</tbody>

For example, if 11.6% and 520 were the results achieved, I need to figure out what the weighted average is between 11% and 12% whilst at the same time the weighted average between 500 and 550 to arrive at a final exact figure. In this example I believe the answer should be Y2968 (rounded to the nearest yen).

Basically I need to be able to calculate any data point in between the known xy figures above.

Thanks in advance
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
My investigations lead me to believe that what you ask is almost impossible with functions and formulas. It is possible to do interpolation for one row at a time or one column at a time, but doing both at once boggles the mind.

The data is not simple-linear. What you need is a User Defined Function, which has been dealt with in this forum.

See here: http://www.mrexcel.com/forum/excel-...-interpolate-simple-linear-interpolation.html
 
Upvote 0
DRSteele is correct, the data are not linear. Trying to come up with a function (formulas or UDF) that "best" interpolates the data is very difficult. I tried using your data and the FORECAST function, and the results were all over.

However, if you are content with simple linear interpolation between points, it's much simpler (but still not "simple"). Consider this sheet:

ABCDEFGHIJK
1300350400450500550600PCTYen
211%187221632448272730003267352811.60%520
312%1733200222662525277730253266
413%1616186721132353258928203045Amt
514%15151750198122072428264428552968.44
615%1428165018672080228824922691
716%135115611767196821662358254726
817%1284148316791870205822412420
918%122414141601178319622136230730003267
1027773025
11500
12550
130.4
142866.23121.8
15
160.11
170.12
180.6

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
K5=J14+(K14-J14)*J13
J7=MATCH(J2,A1:A9)
K7=MATCH(K2,A1:H1)
J9=INDEX(A1:H9,J7,K7)
K9=INDEX(A1:H9,J7,K7+1)
J10=INDEX(A1:H9,J7+1,K7)
K10=INDEX(A1:H9,J7+1,K7+1)
J11=INDEX(A1:H1,1,K7)
J12=INDEX(A1:H1,1,K7+1)
J13=(K2-J11)/(J12-J11)
J14=J9+(J10-J9)*J18
K14=K9+(K10-K9)*J18
J16=INDEX(A1:A9,J7)
J17=INDEX(A1:A9,J7+1)
J18=(J2-J16)/(J17-J16)

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Put the formulas in as shown. (I started to make a 1-cell formula combining all those, but gave up as it would be extraordinarily long and complicated.) Then put the percent and amount in the J2:K2 cells. The example shown gives a result of 2968, which is what you got, leading me to believe that you calculated it the same way.

Let me know if this helps.
 
Upvote 0
Using the FORECAST function, I did manage to reduce the number of formulas:

ABCDEFGHIJK
1300350400450500550600PCTYen
211%187221632448272730003267352811.60%520
312%1733200222662525277730253266
413%1616186721132353258928203045Amt
514%15151750198122072428264428552968.44
615%1428165018672080228824922691
716%135115611767196821662358254726
817%12841483167918702058224124202866.23121.8
918%1224141416011783196221362307

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet6

Worksheet Formulas
CellFormula
K5=FORECAST(K2,J8:K8,OFFSET($A$1:$B$1,0,$K$7-1))
J7=MATCH(J2,A1:A9)
K7=MATCH(K2,A1:H1)
J8=FORECAST(J2,OFFSET($A$1,$J$7-1,$K$7-1,2,1),OFFSET($A$1:$A$2,$J$7-1,0))
K8=FORECAST($J$2,OFFSET($B$1,$J$7-1,$K$7-1,2,1),OFFSET($A$1:$A$2,$J$7-1,0))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



Since I only use the 2 adjacent data points in the formulas, they come out as linear.
 
Upvote 0

Forum statistics

Threads
1,221,877
Messages
6,162,579
Members
451,776
Latest member
bosvinn

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top