To interpolate, find the two known values on either side of the point you want, work out how far between them your point sits, and move the same fraction of the way between their results. As a formula:
y = y1 + (x − x1) × (y2 − y1) / (x2 − x1)
That is linear interpolation, and it covers most homework, engineering table and spreadsheet cases. Below is the method in five steps, three worked examples, how to do it in Excel, and how to tell when a straight line is not enough.
If you just need the number, the interpolation calculator on our homepage does it for you.
How to interpolate in 5 steps
- Find the bracketing values. In your table, find the known x just below your target (x1) and just above it (x2). Write down their results, y1 and y2.
- Work out the fraction. t = (x − x1) / (x2 − x1). This is how far along the gap you are: 0 at x1, 1 at x2 and 0.5 halfway.
- Find the change in y. Δy = y2 − y1. It is negative when the values fall.
- Add that share of the change. y = y1 + t × Δy.
- Check the answer. It must sit between y1 and y2. If it does not, a number has been swapped somewhere.
Example 1: reading a value from a table
A table gives y = 50 at x = 10 and y = 80 at x = 20. Find y at x = 14.
- Fraction: t = (14 − 10) / (20 − 10) = 0.4
- Change: Δy = 80 − 50 = 30
- Answer: y = 50 + 0.4 × 30 = 62
Check: 62 is between 50 and 80. And 14 is a little under halfway from 10 to 20, so an answer a little under the midpoint of 65 makes sense.
Example 2: values that go down
A table gives y = 2.75 at x = 100 and y = 2.30 at x = 150. Find y at x = 130.
- Fraction: t = (130 − 100) / (150 − 100) = 0.6
- Change: Δy = 2.30 − 2.75 = −0.45
- Answer: y = 2.75 + 0.6 × (−0.45) = 2.75 − 0.27 = 2.48
Keep the minus sign. The most common slip with falling values is subtracting the wrong way round and landing outside the two known results.
Example 3: interpolating between dates
The x values do not have to be plain numbers. Dates work once you turn them into day counts. Say a savings balance grew steadily from 1,200 on 1 March to 1,500 on 31 March, 30 days later. To estimate it on 11 March, 10 days in:
- Fraction: t = 10 / 30 = 0.333…
- Change: Δy = 1,500 − 1,200 = 300
- Answer: y = 1,200 + 0.333… × 300 = 1,300
Percentages work the same way. Treat 2.5% as 2.5 and interpolate as normal.
How to interpolate in Excel
Put the two known x values in A2:A3 and their y values in B2:B3. With the target x in D2, enter:
=FORECAST.LINEAR(D2, B2:B3, A2:A3)
With exactly two points this returns the linear interpolation. With more rows, it fits one best-fit line through all of them instead, so give it only the two bracketing rows. Older versions of Excel use FORECAST with the same arguments. Our linear interpolation in Excel guide shows a version that finds the bracketing rows for you.
How to interpolate with two inputs
When the result depends on two inputs, such as pressure and temperature in a steam table, interpolate twice. First interpolate along one input in each of the two bracketing rows. Then interpolate between those two results along the other input. The double interpolation guide and the steam table interpolation guide walk through it, and the bilinear interpolation calculator does it in one go.
When a straight line is not enough
Linear interpolation assumes the data runs straight between the two points. If the data curves, the straight line cuts the corner. On the curve y = x², for example, the points (1, 1) and (2, 4) give a linear estimate of 2.5 at x = 1.5, while the true value is 2.25.
You can do better in three ways:
- Use known points closer together, if your table has them. The shorter the gap, the smaller the error.
- Fit a curve through three or more points with polynomial interpolation, or let the Lagrange interpolation calculator do it.
- For many points, use a cubic spline, which bends smoothly without the wild swings of a high-degree polynomial.
Every formula, with a worked example for each, is on our interpolation formula page.
What if your value is outside the table?
Everything above assumes your x lies between two known points. If it lies before the first point or after the last one, you are extrapolating. The same formula works, but the result is a projection that can drift a long way from reality. See interpolation vs extrapolation before you rely on it.
FAQs
What does it mean to interpolate?
To interpolate is to estimate an unknown value that falls between two or more known values, assuming the pattern between them holds. Reading a value between two rows of a table is the everyday example.
How do you interpolate between two numbers?
Decide how far along you are as a fraction, then take that fraction of the gap and add it to the first number. Halfway between 40 and 60 is 40 + 0.5 × 20 = 50. A quarter of the way is 40 + 0.25 × 20 = 45.
What is the quickest way to interpolate in an exam?
Fraction times difference, plus the starting value. If 14 sits between 10 and 20, it is 0.4 of the way along, so take 0.4 of the gap between the two results and add it to the lower one.
How accurate is interpolation?
It is as good as the assumption that the data is straight, or follows your chosen curve, between the known points. Closer points and smoother data give better estimates. For curved data, a curve-fitting method beats a straight line.