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 Formulas<br />

3.1 Common Formula Structure<br />

3.1.1 Common Structure<br />

Formulas are stored as part of a record, for instance inside of a FORMULA record or a DEFINEDNAME record. <strong>The</strong><br />

common format of a formula is as follows:<br />

Formula in BIFF2:<br />

Offset Size Contents<br />

0 1 Size of the following formula data (RPN token array, sz)<br />

1 sz Formula data (RPN token array)<br />

[1+sz] var. (optional) Additional data for specific tokens (➜3.1.6, for example tArray token, ➜3.8.7)<br />

Formula in BIFF3-BIFF8:<br />

Offset Size Contents<br />

0 2 Size of the following formula data (sz)<br />

2 sz Formula data (RPN token array)<br />

[2+sz] var. (optional) Additional data for specific tokens (➜3.1.6, for example tArray token, ➜3.8.7)<br />

Sometimes the size field is not stored directly before the RPN token array, but somewhere else. If this happens, it will be<br />

mentioned at the respective place. If there does not exist any formula data, only the size field (which contains 0 then) is<br />

present.<br />

3.1.2 Tokens<br />

Definition: Formula token<br />

Formula tokens are the indivisible particles of a formula. <strong>The</strong>re might be operators, numerical or string constants<br />

or function names.<br />

Each token contains a token identifier. Several tokens contain additional information. A token does not contain any size<br />

information, so importing and exporting tokens must be done carefully.<br />

Common structure of a formula token, BIFF2-BIFF8:<br />

Offset Size Contents<br />

0 1 Token identifier<br />

[1] var. (optional) Additional data for the token<br />

28

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

Saved successfully!

Ooh no, something went wrong!