Skip to content
Spreadsheet Engine

Cell

Cell object. Instances of this are stored in the cell map of each sheet of each Workbook.

new Cell(
orgCell,
id?,
container?
): Cell;

Construct a Cell instance.

Cell | CellData

object to copy attributes from (all optional, this may be empty)

string | null

unqualified address in A1 format

CellContainer

Cell

dataTable: DataTable | null;

Data table metadata, set only on the anchor cell of the data table range.


f: string | null;

formula, if any

CellInterface.f


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

Formula type:

  • 'a': dynamic-array formula (auto-resizing spill)
  • 'cse': legacy Ctrl-Shift-Enter array formula (fixed output 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

CellInterface.ft


id: string;

this cell’s address ID in A1 format (unprefixed)

CellInterface.id


M: string | null;

top-left anchor cell-id of merge-area if cell is merge


readonly z: string | null;

The effective number format of the cell (cached). Updated automatically when style or value changes.

CellInterface.z

get colIndex(): number;

number


get F(): string | null;

string | null


get formulaZ(): string | null;

The cell’s formula-assigned number format (read-only accessor). Returns the number format from the boxed value metadata if present.

string | null

CellInterface.formulaZ


get href(): string | null;

string | null

set href(href): void;

string | null

void


get hrefFromFormula(): string | null;

Hyperlink URL derived from HYPERLINK() formula evaluation (ephemeral).

string | null

set hrefFromFormula(url): void;

string | null

void


get rowIndex(): number;

number


get sheetIndex(): number;

number

CellInterface.sheetIndex


get style(): StyleRelaxed | null;

The cell’s style object containing formatting properties like fonts, colors, borders, and number formats.

Migration note: This property was previously named s. Code accessing cell.s should be updated to use cell.style instead.

Related properties:

  • z - The effective number format, read-only

The setter accepts either:

  • A StyleRelaxed object (will be deduplicated and stored by index)
  • A numeric style index (for efficiency when you already have the index)
  • null (to clear the style)
// Set a style object
cell.style = { color: '#FF0000', bold: true };
// Clear the style
cell.style = null;

StyleRelaxed | null

set style(newStyle): void;

StyleRelaxed | null

void


get v(): CellValue;

CellValue

set v(value): void;

Set the value of the cell. If the value is a boxed value, the number format will become the cell’s formula-assigned number format.

MaybeBoxed<CellValue>

void

CellInterface.v


get valueBoxed(): MaybeBoxed<CellValue>;

The value of the cell. If the cell’s value has a formula-assigned number format, the value will be a boxed value containing that number format.

MaybeBoxed<CellValue>

CellInterface.valueBoxed


get workbookKey(): number;

number

CellInterface.workbookKey

clear(): void;

void

CellInterface.clear


hasValueOrFormula(): boolean;

boolean

CellInterface.hasValueOrFormula


isSpillAnchor(): boolean;

boolean

CellInterface.isSpillAnchor


isSpilled(): this is Cell & { _spill: { valid: true }; F: string; sheetIndex: number };

Is part of a spilled range.

this is Cell & { _spill: { valid: true }; F: string; sheetIndex: number }

CellInterface.isSpilled


spillHeight(): number;

number

CellInterface.spillHeight


spillWidth(): number;

number

CellInterface.spillWidth


toString(): string;

string

CellInterface.toString