Contact

CELL Function (Gnumeric)

Information Beginner Gnumeric

Inspect a referenced cell with Gnumeric CELL, using supported information selectors and recognizing format-dependent results.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

CELL reports a selected property of a referenced cell, such as its row, value type, or sheet name. It is useful for worksheet diagnostics, but its selectors have product-specific behavior. In particular, Gnumeric 1.12.57 does not implement every formatting selector as a genuine inspection of the cell’s appearance.

Syntax and selector families

CELL(type, cell)

type is a quoted selector string; cell is a reference. Supply both arguments. Gnumeric’s implementation compares the English selector names without regard to ASCII letter case. A range is accepted, but the implementation examines its first endpoint; it does not return one result per cell.

Important selectors include:

  • row, col, and column: one-based coordinates.
  • address and coord: address text.
  • contents and value: the referenced cell’s value, not its formula source.
  • type, datatype, and formulatype: l for text, v for other stored values, and b for a blank cell.
  • sheetname: the sheet’s name; filename: the workbook’s URI, or an empty string when no URI is available.
  • format: a compact format classification, not the complete number-format pattern.
  • locked and protect: the cell’s locked-style flag, not proof that protection is actively enforced.
  • width and columnwidth: an approximate column width in character units.
  • prefix and prefixcharacter: an alignment-related marker for text cells.

In this version, color and parentheses return constant zero. Do not use them to detect colored or parenthesized number formats. The built-in help’s broader description of parentheses is not implemented by the pinned callback.

Worked example: inspect a small input sheet

Name a sheet Tests. Put 25 in A1, the text sample in A2, and =A1*2 in A3. Leave A9 empty. Place diagnostics in another column:

Formula Native result
=CELL("row",C4) 4
=CELL("col",C4) 3
=CELL("address",C4) $C$4
=CELL("contents",A1) 25
=CELL("type",A1) v
=CELL("type",A2) l
=CELL("type",A9) b
=CELL("sheetname",A1) Tests

The referenced cell need not contain a value for its row or column to be meaningful. Coordinates are properties of the reference, not a count of populated cells.

Advanced use: avoid misleading diagnostic names

=CELL("formulatype",A3) returns v for the example formula’s numeric result. Despite its name, this selector is an alias of type; it does not identify the expression as a formula. Use ISFORMULA for formula presence or a formula-inspection function when you need the expression itself.

Similarly, =CELL("contents",A1:A2) returns 25, the first cell’s value, rather than a two-element array. Keep a diagnostic column with one reference per row if you need to inspect a block.

The filename selector can expose a path or URI. Review diagnostic output before sharing it externally, and do not assume the returned URI matches another application’s filename convention. Format classification can also be lossy: it is not a serialization of every custom-format detail.

Errors and troubleshooting

=CELL("unknown",A1) returns #VALUE!. Check selector spelling and ensure the second argument is a reference. If a property appears unchanged after formatting edits, recalculate and verify the actual supported selector; recalculation cannot turn the constant-zero color and parentheses branches into real inspectors.

For locking, distinguish a cell’s locked flag from active sheet protection. For width, do not treat the rounded character-unit result as exact pixels. For text classification, remember that a numeric-looking string is still text.

Version and verification

This guide is scoped to official Gnumeric 1.12.57 source and 13 native checks under C.UTF-8 on 17 October 2026. Those checks cover the displayed selectors, aliases, first-cell range behavior, and unsupported selector. Formatting and protection UI interactions were not tested. The first CELL release is not established here; no retirement is inferred.

ROW, COLUMN, and ISFORMULA provide more focused inspections. INDIRECT resolves address text when that is actually needed.

Official references