Skip to content

EvaluateExpressionOptions

Values extends boolean = boolean

Single extends boolean = boolean

Fallback = unknown

optional cropTo?: "any-cell-information" | "cells-with-non-blank-values";

How to size the returned area when single is false.

  • 'any-cell-information' (the default): return the full populated rectangle, keeping cells that carry any data --- values, formulas, or style-only metadata.

  • 'cells-with-non-blank-values': trim trailing rows and columns whose cells are all blank-valued. Cells with no value, empty-string values, or #N/A errors all count as blank; a blank cell in a merged region (Cell.M set) is still treated as data and prevents that column or row from being trimmed.


optional definedName?: Values extends false ? Single extends true ? boolean : never : never;

True if a single cell is to be returned, and it should be a defined-name cell if that defined name evaluates to a cell value or array (i.e. not a reference). If this is true, then values is ignored and assumed false, and single is ignored and assumed true.


optional extraContext?:
| Partial<EvaluationContext>
| null;

Extra context to pass to Model.runFormula(), which is then passed through to the formula runner.


fallBack: Fallback;

Value to return if expression is null or empty or =, or if options.single is true and the expression does not resolve to a single cell/value.


single: Single;

True if a single cell or value is to be returned; false for a 2-D array of cells or values.


values: Values;

True if bare values are to be returned, false for Cell objects.