Skip to content
Spreadsheet Engine

CellData

type CellData = Omit<Cell$1, "f" | "v" | "s" | "dt"> & object;

Cell data, as passed to Workbook.editCell: the JSF JSFCell | Cell type, except that f, v and s are typed as below and ft is added. null in f, v or s clears that field in an edit.

dt?: DataTable | null;

What-if data table metadata. On an edit, establishes (or replaces) a data table anchored at the edited cell; null removes the data table anchored there. See Workbook.editCell.

f?: string | null;

Formula string (never an index into the workbook’s formulas)

ft?: "a" | "cse" | "plain" | null;

Formula type:

  • 'a': dynamic-array formula (auto-resizing spill, may grow/shrink/#SPILL!)
  • 'cse': legacy Ctrl-Shift-Enter array formula (fixed output range; result is broadcast/truncated/#N/A-padded to that range)
  • 'plain': formula loaded from a file without an array mark (a plain <f> in XLSX, no F in JSF), outside Google Sheets mode; evaluated by Excel’s pre-dynamic-array rules
  • absent/null: the default type, which a newly entered formula has; evaluated by dynamic-array rules, except in Google Sheets mode, where it is a single-cell formula
s?: number | Style | null;

Style index, or Style object. In an edit this replaces the cell’s whole style, number format included. A cell new to a styled row or column keeps that row or column style under it.

v?:
| string
| number
| boolean
| FormulaError
| null;

Cell value, which may be a FormulaError

z?: undefined;

No longer accepted; write the number format as s: { ...cell.style, numberFormat }

zf?: undefined;

Not accepted; a formula’s number format comes from evaluating it