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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3.3 Cell Addresses in Tokens<br />

3.3.4 Cell Addresses in BIFF8<br />

From BIFF8 on, 65536 (2 16 ) rows are available. A cell address contains the row index as a 16-bit value, the column<br />

index as an 8-bit value, and two flags. <strong>The</strong> flags are encoded into the column index (which therefore needs 2 bytes), and<br />

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

described in 3.3.1.<br />

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

Bit Mask Contents<br />

7-0 00FF H Index to column (0…255) or column offset (method [B], -128…127)<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, BIFF8:<br />

Offset Size Contents<br />

0 2 Index to row (0…65535) or row offset (method [B], -32768…32767)<br />

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

Cell range address, BIFF8:<br />

Offset Size Contents<br />

0 2 Index to first row (0…65535) or offset of first row (method [B], -32768…32767)<br />

2 2 Index to last row (0…65535) or offset of last row (method [B], -32768…32767)<br />

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

6 2 Index to last column or offset of last column, with relative flags (see table above)<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 row index is 0005 H (row 6). <strong>The</strong> value of the<br />

encoded column index is 4001 H (column B, column is relative). Though the column is relative, the fixed index<br />

to 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 row index is 0005 H (row 6). <strong>The</strong><br />

value of the encoded column index is 7FFF H (the signed 14-bit offset 3FFF H = –1, and the column relative flag).<br />

39

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

Saved successfully!

Ooh no, something went wrong!