2.2.1 Cell Table
Text, formulas, and numerical data within workbooks are primarily stored in the cells that make up worksheets (section 18.104.22.168.5) and macro sheets (section 22.214.171.124.4). Cells are the fundamental building blocks that contain data, formulas, and formatting to form the workbook. The data structure associated with the grid of cells is called the cell table.
The cell table is stored in the sequence of records that conform to the CELLTABLE rule (section 126.96.36.199.6) within the Common Productions ABNF. The cell table consists of a series of row blocks. From the first row containing data to the last row containing data, every 32 consecutive rows, including blank rows, comprise a row block.
if ((rwMac –rwMic) % 32 == 0) number of row blocks = (rwMac –rwMic) / 32 else number of row blocks = (rwMac –rwMic) / 32 + 1
Within each row block, a Row record (section 2.4.221) is saved for each row that contains data or row formatting. For each such row, every cell that contains data or individual cell formatting is represented by a record. Formatting information for a cell can be derived from individual cell formatting, row formatting, column formatting, or the default cell format as specified by the XFIndex structure (section 2.5.282). The order of precedence for formatting is individual cell formatting with the highest precedence, followed by row formatting, and then column formatting, and then the default cell format. Cells that do not contain data and do not contain individual formatting are not saved.
Cells are specified by any of the records specified in the CELL rule (section 188.8.131.52.6). Multiple cells can be represented by one record—for example, a MulBlank record (section 2.4.174) specifies a series of blank cells. Note that blank cells are only included when they contain individual cell formatting. Rows are saved in increasing order, and cells are saved in row-major order.
The order of the records that comprise a row block begins with a series of Row records (a maximum of 32 such records), followed by the records representing the cells, followed by the DBCell record (section 2.4.78). A cell in the cell table is referred to by its row and column indexes, which are zero-based. The maximum row index is 65535. The maximum column index is 255.
The bounding box of the non-empty cells is stored in the Dimensions record. Information that applies to each column is specified in the COLUMNS collection (section 184.108.40.206.6).