id x val
-------------
1 1 8.18
2 3 8.35
3 5 8.51
4 7 8.52
5 10 8.54
6 15 8.57
7 1 8.35
8 3 8.60
9 5 8.70
10 7 8.75
11 10 8.76
12 15 8.82
13 1 8.55
14 3 8.80
15 5 8.91
16 7 8.95
17 10 8.96
18 15 9.04
19 1 8.75
20 3 9.04
21 5 9.15
22 7 9.21
23 10 9.24
24 15 9.27
Expected result:
1 8.18 8.35 8.55 8.75 -- from table
2 8.27 8.48 8.68 8.89 -- interpolated
3 8.35 8.60 8.80 9.04 -- from table
4 8.43 8.65 8.86 9.09 -- interpolated
5 8.51 8.70 8.91 9.14 -- from table
6 8.52 8.73 8.93 9.17 -- interpolated
7 8.52 8.75 8.95 9.21 -- from table
8 8.53 8.75 8.95 9.22 -- interpolated
9 8.53 8.75 8.95 9.23 -- interpolated
10 8.54 8.76 8.96 9.24 -- from table
15 8.57 8.82 9.04 9.27 -- from table
Best Answer
Sample data
Pivot
The first step is to pivot the data we have:
Next we need to know the range of values in the table so we can fill in the blanks:
Now we can find the missing rows, and the real rows on either side (for interpolation):
Finally, we compute interpolated values for the missing rows, and return the results:
Results
These numbers are rounded to three decimal places using SQL Server's default rounding. If you need to mimic e.g. Excel rounding, you would need to use a function that implements that specific algorithm.
Tested on SQL Server 2008 R2 with compatibility level 80, as indicated in your previous questions.
db<>fiddle (SQL Server 2012, earliest version available)