Convenience constructor for an error FormulaResult restricted to the no-extra-field error variants.

Variants requiring extra fields beyond kind/message (unresolved-ref, non-numeric, propagated) cannot be expressed through this helper without losing the type-level guarantee that those fields are present. Callers needing those variants must build the FormulaError object directly and use errResult.

  • Parameters

    • kind: "div-by-zero" | "unknown-function" | "argument-error"

      One of the no-extra-field error tags.

    • message: string

      Human-readable description for diagnostics.

    • Optionalref: string

      Optional A1 reference for the div-by-zero variant only; unknown-function/argument-error shapes do not carry one and the parameter is ignored for those tags.

    Returns FormulaResult

    Result with kind: 'error' carrying a FormulaError.