07.05.2014 Views

The Microsoft Excel File Format - OpenOffice.org

The Microsoft Excel File Format - OpenOffice.org

The Microsoft Excel File Format - OpenOffice.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3 Formulas<br />

3.3.3 Cell Addresses in BIFF2-BIFF5<br />

In the file format versions up to BIFF5, it is possible to use 16384 (2 14 ) rows. A cell address contains the row index as a<br />

14-bit value, the column index as an 8-bit value, and two flags. <strong>The</strong> flags, encoded into the row index, specify whether<br />

the row or column index is absolute or relative. <strong>The</strong> differences in interpreting relative indexes are described in 3.3.1.<br />

Index to row or row offset, with embedded relative flags (16-bit value), BIFF2-BIFF5:<br />

Bit Mask Contents<br />

13-0 3FFF H Index to row (0…16383) or row offset (method [B], -8192…8191)<br />

14 4000 H 0 = Absolute column index 1 = Relative column index, or column offset<br />

15 8000 H 0 = Absolute row index 1 = Relative row index, or row offset<br />

Cell address, BIFF2-BIFF5:<br />

Offset Size Contents<br />

0 2 Index to row or row offset, with relative flags (see table above)<br />

2 1 Index to column (0…255) or column offset (method [B], -128…127)<br />

Cell range address, BIFF2-BIFF5:<br />

Offset Size Contents<br />

0 2 Index to first row or offset of first row, with relative flags (see table above)<br />

2 2 Index to last row or relative offset of last row, with relative flags (see table above)<br />

4 1 Index to first column (0…255) or offset of first column (method [B], -128…127)<br />

5 1 Index to last column (0…255) or offset of last column (method [B], -128…127)<br />

Example for a reference in a cell formula (method [A], token tRef): <strong>The</strong> reference B$6 consists of the absolute<br />

row index 5 and the relative column index 1. <strong>The</strong> value of the encoded row index is 4005 H (row 6, column is<br />

relative). <strong>The</strong> value of the column index is 01 H (column B). Though the column is relative, the fixed index to<br />

column B is stored in cell formulas.<br />

Example for a relative reference in a shared formula (method [B], token tRefN): <strong>The</strong> reference “decrease column<br />

by 1, absolute row 6” (which would evaluate to the address B6, if used in cell C1) consists of the absolute row<br />

index 5, and (in shared formulas) the relative column offset –1. <strong>The</strong> value of the encoded row index is 4005 H<br />

(row 6, column is relative). <strong>The</strong> value of the column index is FF H (the signed offset –1).<br />

38

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!