# openpyxl.cell.cell module

Manage individual cells in a spreadsheet.

The Cell class is required to know its value and type, display options, and any other features of an Excel cell. Utilities for referencing cells using Excel’s ‘A1’ column/row nomenclature are also provided.

class openpyxl.cell.cell.Cell(worksheet, row=None, column=None, value=None, style_array=None)

  Bases: `StyleableObject`

  Describes cell associated properties.

  Properties of interest include style, type, value, and address.

  property base_date
  check_error(value)

    Tries to convert Error” else N/A

  check_string(value)

    Check string coding, length, and line break character

  property col_idx

    The numerical index of the column

  column

    Column number of this cell (1-based)

  property column_letter
  property comment

    Returns the comment associated with this cell

    Type:

      `openpyxl.comments.Comment`

  property coordinate

    This cell’s coordinate (ex. ‘A5’)

  data_type
  property encoding
  property hyperlink

    Return the hyperlink target or an empty string

  property internal_value

    Always returns the value for excel.

  property is_date

    True if the value is formatted as a date

    Type:

      bool

  offset(row=0, column=0)

    Returns a cell location relative to this cell.

    Parameters:

      - row (int) – number of rows to offset

      - column (int) – number of columns to offset

    Return type:

      `openpyxl.cell.Cell`

  parent
  row

    Row number of this cell (1-based)

  property value

    Get or set the value held in the cell.

    Type:

      depends on the value (string, float, int or `datetime.datetime`)

class openpyxl.cell.cell.MergedCell(worksheet, row=None, column=None)

  Bases: `StyleableObject`

  Describes the properties of a cell in a merged cell and helps to display the borders of the merged cell.

  The value of a MergedCell is always None.

  column
  comment = None
  property coordinate

    This cell’s coordinate (ex. ‘A5’)

  data_type = 'n'
  hyperlink = None
  row
  value = None

openpyxl.cell.cell.WriteOnlyCell(ws=None, value=None)

openpyxl.cell.cell.get_time_format(t)

openpyxl.cell.cell.get_type(t, value)