Skip to content
Office Open

XLSX

Cells & Data

Cell data types, row structure, and basic data entry

Cells are the building blocks of worksheets. Each cell holds a value and optional style.

#Cell Values

JSON
{
  "worksheets": [
    {
      "name": "Sheet1",
      "rows": [{ "cells": [{ "value": "Hello" }, { "value": 42 }, { "value": true }] }]
    }
  ]
}

Supported value types:

TypeExampleDescription
string{ value: "Hello" }Shared string reference
number{ value: 42 }Inline numeric value
boolean{ value: true }Boolean value (0/1)
Date{ value: new Date("2024-01-01") }Serial number
null{ value: null }Empty cell (skipped)

#Styled Cells

Apply styles directly to cells:

JSON
{
  "worksheets": [
    {
      "name": "Sheet1",
      "rows": [
        {
          "cells": [
            {
              "value": "Header",
              "style": {
                "font": { "bold": true },
                "fill": { "foregroundColor": { "rgb": "FF4472C4" } }
              }
            },
            { "value": 100, "style": { "numFmt": "#,##0" } }
          ]
        }
      ]
    }
  ]
}

See Styles for the full list of style options.

#Row Heights

Set custom row heights:

JSON
{
  "worksheets": [
    {
      "name": "Sheet1",
      "rows": [{ "cells": [{ "value": "Tall row" }], "height": 30 }]
    }
  ]
}

#Hidden Rows

JSON
{
  "worksheets": [
    {
      "name": "Sheet1",
      "rows": [
        { "cells": [{ "value": "Visible" }] },
        { "cells": [{ "value": "Hidden" }], "hidden": true }
      ]
    }
  ]
}

#Number Formats

Common number format patterns:

PatternInputDisplay
#,##012341,234
#,##0.001234.51,234.50
0%0.8585%
yyyy-mm-ddDate2024-01-01

#Cell Options Reference

OptionTypeDescription
valuestring | number | boolean | Date | RichTextOptions | nullCell value (auto-reference when omitted)
referencestringExplicit cell reference, e.g. "A1"
styleStyleOptions | numberCell style, or the raw cellXfs index as a round-trip fallback (see Styles)
formulaFormulaOptionsCell formula; value is the cached result

#Row Options Reference

OptionTypeDescription
cellsCellOptions[]Array of cells
heightnumber | UniversalMeasureRow height in points or UniversalMeasure
hiddenbooleanHide the row