Skip to content

excel cell get

zmworm edited this page Apr 29, 2026 · 51 revisions

Excel: Cell - get

Get cell values, formatting, and row/column properties.

Path: /{SheetName}/A1, /{SheetName}/A1:D10, /{SheetName}/row[N], /{SheetName}/col[A]

Cell Attributes

Attribute Type Description
value any The cell's display value. Date/percent cells are formatted via the cell's number format — e.g. "2024-01-15" (not 45306), "42.50%" (not 0.425).
type string Number, String, SharedString, Boolean, Error
formula string Formula expression (e.g., =SUM(A1:A10))
empty boolean Whether the cell is empty
link string Hyperlink URL or internal reference
font.bold / bold boolean Bold text
font.italic / italic boolean Italic text
font.strike boolean Strikethrough text
font.underline string Underline style
font.color string Font color (#RRGGBB)
font.size string Font size with pt suffix (e.g., "12pt")
font.name string Font family name
fill string Background fill color (#RRGGBB), or gradient as "gradient;#C1;#C2;deg"
border.left string Left border style
border.right string Right border style
border.top string Top border style
border.bottom string Bottom border style
border.left.color string Left border color (hex RGB, FF alpha prefix stripped)
border.right.color string Right border color (hex RGB, FF alpha prefix stripped)
border.top.color string Top border color (hex RGB, FF alpha prefix stripped)
border.bottom.color string Bottom border color (hex RGB, FF alpha prefix stripped)
border.diagonal string Diagonal border style
border.diagonal.color string Diagonal border color (hex RGB, FF alpha prefix stripped)
border.diagonalUp boolean Diagonal-up border enabled
border.diagonalDown boolean Diagonal-down border enabled
alignment.wrapText boolean Text wrapping enabled
alignment.horizontal string Horizontal alignment
halign string Horizontal alignment (alias)
alignment.vertical / valign string Vertical alignment
alignment.textRotation number Text rotation angle
alignment.indent number Indent level
alignment.shrinkToFit boolean Shrink text to fit cell
numFmtId number Number format ID
numberformat string Number format string (built-in IDs resolved to format strings)
merge string Merge range if cell is part of a merged area
mergeAnchor boolean true if this cell is the top-left anchor of a merged range
richtext boolean true if cell contains multiple runs with different formatting
cachedValue any Last calculated value for formula cells
uncalculated boolean true if formula cell has no cached value yet
locked boolean Cell locked when sheet is protected (only present when ApplyProtection=true)
formulahidden boolean Formula hidden in formula bar when protected (only present when ApplyProtection=true)
superscript boolean Superscript text
subscript boolean Subscript text
arrayformula boolean true if cell contains an array formula
arrayref string Array formula reference range (e.g., A1:B10)

Row Attributes

Attribute Type Description
height number Row height
hidden boolean Whether the row is hidden

Column Attributes

Attribute Type Description
width number Column width
hidden boolean Whether the column is hidden
customWidth boolean Whether a custom width is set

Rich Text Run Attributes

When richtext=true, individual runs are accessible at /Sheet1/A1/run[N]:

Attribute Type Description
text string Run text content
bold, italic, strike boolean Text style flags
underline string Underline style
superscript, subscript boolean Vertical alignment
size string Font size (e.g., "12pt")
color string Font color (#RRGGBB)
font string Font family name
officecli get data.xlsx /Sheet1/A1/run[1]
officecli get data.xlsx /Sheet1/A1/run[2]

Examples

# Get a single cell
officecli get data.xlsx /Sheet1/A1
/Sheet1/A1
  value: Revenue
  type: SharedString
  font.bold: true
  font.size: 12pt
  font.name: Calibri
  font.color: #333333
# Get a cell range
officecli get data.xlsx /Sheet1/A1:D10

# Get a row
officecli get data.xlsx /Sheet1/row[5]
/Sheet1/row[5]
  height: 20
  hidden: false
# Get a column
officecli get data.xlsx /Sheet1/col[A]

# Get as JSON
officecli get data.xlsx /Sheet1/A1 --json

See Also


Based on OfficeCLI v1.0.64

Clone this wiki locally