Not sure why VLOOKUP is suggested for interpolation I always use the following function for interpolation.
regards,
athomas236
Function Interp(X, Y, Xe)
' This function interpolates and extrapolates linearly on
' arrays of X and Y values
' Input is as follows
' Array of X values that are in a sequence of increasing values
' Array of Y values
' Value Xe for which value of Y is required
' Count number of X values
For Each Item In X
CountX = CountX + 1
Next Item
' Count number of Y values
For Each Item In Y
CountY = CountY + 1
Next Item
If CountX >= 2 Then GoTo 10
' Error not enough values so end calculation
Msg = "Need at least 2 values of X"
Ans = MsgBox(Msg, vbOKOnly)
Interp = "Error"
GoTo 400
10 If CountX = CountY Then GoTo 100
' Error should be equal number of X and Y values
Msg = "Need equal number of X & Y values"
Ans = MsgBox(Msg, vbOKOnly)
Interp = "Error"
GoTo 400
100 If Xe > X(1) Then GoTo 200
' Xe less than smallest X
Interp = Y(2) - ((Y(2) - Y(1)) / (X(2) - X(1)) * (X(2) - Xe))
GoTo 400
200 If Xe < X(CountX) Then GoTo 300
' Xe greater than largest X
Interp = Y(CountX - 1) + ((Y(CountX) - Y(CountX - 1)) / (X(CountX) - X(CountX - 1)) * (Xe - X(CountX - 1)))
GoTo 400
300 For Item = 1 To CountX
If Xe >= X(Item) And Xe <= X(Item + 1) Then GoTo 310
Next Item
310 Interp = (Y(Item + 1) - Y(Item)) / (X(Item + 1) - X(Item)) * (Xe - X(Item)) + Y(Item)
400 '
End Function