Function Interp(x as range, y as range, xint) as single Dim I as integer For i=2 to x.rows.count-1 if xint <= x(i) then exit for Next I Interp = y(i-1) +(y(i)-y(i-1))/(x(i)-x(i-1))*(xint-x(i-1)) End function