Public Function Interpolation2Dim(ByVal B As Range, x, y)
Spaln = B.Columns.Count
Zeiln = B.Rows.Count
Horiz = B.Offset(0, 1).Resize(1, Spaln - 1)
Verti = B.Offset(1, 0).Resize(Zeiln - 1, 1)
Matri = B.Offset(1, 1).Resize(Zeiln - 1, Spaln - 1)
i = Application.Match(y, Verti)
j = Application.Match(x, Horiz)
xu = Horiz(1, j + 0): mu = Matri(i + 0, j + 0)
xo = Horiz(1, j + 1): mo = Matri(i + 0, j + 1)
yu = Verti(i + 0, 1): nu = Matri(i + 1, j + 0)
yo = Verti(i + 1, 1): no = Matri(i + 1, j + 1)
mm = (x - xu) / (xo - xu) * (mo - mu) + mu
nm = (x - xu) / (xo - xu) * (no - nu) + nu
nn = (y - yu) / (yo - yu) * (nm - mm) + mm
Interpolation2Dim = nn
End Function
Aufruf der Funktion:
C24: =Interpolation2Dim($A$3:$Y$11;A24;B24)