SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface EvaluateOptions

    Options for evaluating a formula.

    interface EvaluateOptions {
        alwaysReturnRange?: boolean;
        arrayFirstCell?: boolean;
        block?: Coords;
        evalIndex?: number;
        values?: IRange<Scalar>;
    }
    Index
    alwaysReturnRange?: boolean

    If specified, the result will always be returned as an IRange, even when the logical result is a single scalar value.

    By default, formulas that evaluate to a single cell return a scalar value. Setting this to true disables that scalar unboxing and keeps the result in range form (1×1), which can be useful for batch-oriented or shape-sensitive consumers.

    arrayFirstCell?: boolean

    With block: evaluate each cell of the block as an array-entered formula whose extent is that one cell.

    This is how a conditional-format or data-validation formula is evaluated. Nothing implicitly intersects — a range reads as the whole array wherever it appears — and each cell keeps the top-left value of its own result, the way an array-entered formula fits its result to its extent. So $J$1:$J$9="x" answers J1="x" in every cell, while SUM(IF($J$1:$J$9="x",1,0))>1 still sums the whole array.

    By default a cell whose result is an array spills, as a formula filled across the block would.

    false

    block?: Coords

    Evaluate the formula once per cell of the given coordinates.

    • The formula must be anchored at the top-left of block (the coords passed to ICalculation.createFormula); relative and structured references are adjusted per-cell, exactly as a formula filled across the shape.
    • The result is an IRange of the block's shape, read with local coordinates (getValueAt(0, 0) is the block's top-left). A 1×1 block still unboxes to a scalar unless alwaysReturnRange is set.
    • A cell whose evaluation errors carries the error as that cell's value; other cells are unaffected.
    • Evaluated by the engine, in one pass, exactly as a formula filled across the shape.
    • Honored by temporary formulas (ICalculation.evaluate / ICalculation.createFormula); a committed cell formula ignores it.
    • Often used for "preview this formula over this region" or batched validation of an expression over a condition range.
    evalIndex?: number

    If specified, evaluates only the token span associated with this index.

    -1 (full evaluation)

    Use ICalculation.FormulaToken.evalIndex to discover valid indices.

    values?: IRange<Scalar>

    Temporary range of values to use for this evaluation.

    • Not implemented yet — evaluation currently ignores this option.
    • Does not mutate the workbook.
    • Acts as a pure overlay for one or more precedents used by this formula.
    • Typically a literal or computed IRange created via ctx.getRange(...) in predicates or editors.