QS.INTERPOLATE¶
Interpolates numeric ranges using Linear, LogLinear, or a natural CubicSpline
Category: QuantSupport - Math.
- QS.INTERPOLATE(point: number, x_values: cell or range, y_values: cell or range, method: text or blank, enable_extrapolation: cell or range) number¶
- Parameters:
point (number) – Finite numeric query coordinate on the corresponding axis
x_values (cell or range) – Required numeric range of at least two strictly increasing finite x coordinates; duplicate coordinates, blanks, text, and booleans are rejected; ranges are read in row-major order
y_values (cell or range) – Required finite numeric values aligned with x_values, with the same cell count; log-linear interpolation requires strictly positive values; blanks, text, and booleans are rejected
method (text or blank) – Optional Linear, LogLinear, or CubicSpline; omitted, blank, or empty text defaults to Linear; CubicSpline uses natural boundary conditions
enable_extrapolation (cell or range) – Optional TRUE/FALSE or finite numeric flag (nonzero is TRUE); omitted or blank defaults to FALSE; TRUE extends the native end interval (linear, log-linear, or cubic polynomial)
- Returns:
Finite numeric interpolated value in the input values’ units. One-dimensional data requires at least two strictly increasing coordinates; extrapolation is disabled by default. CubicSpline uses a natural spline and falls back to linear interpolation with two points.
- Return Type:
number
- Errors:
#VALUE! for invalid methods or flags, blank/text/boolean/nonfinite range cells, mismatched ranges, fewer than two points, unordered or duplicate x coordinates, nonpositive log-linear values, forbidden extrapolation, or a nonfinite result.
Formula¶
=QS.INTERPOLATE(point, x_values, y_values, method, enable_extrapolation)
Calculation¶
Thread-safe worksheet function.
Native Declaration¶
fn qs_interpolate (point : f64 , x_values : * const XLOPER12 , y_values : * const XLOPER12 , method : Option < String > , enable_extrapolation : * const XLOPER12 ,) -> Result < f64 , XllError >