Introduction
BIFF2, BIFF3 and BIFF4 are the formats of Excel 2.x, Excel 3.0 and Excel 4.0. In these
versions a file holds one sheet (a worksheet, a chart or a macro sheet), so there was
no workbook of several sheets yet; Excel 5.0 introduced that, in
BIFF5. Excel 3.0 and 4.0 also wrote
workspace files (.xlw), covered at the end of the records page.
Text is stored in single-byte characters in the file’s code page, written into each cell record. The versions differ in how cell formatting is stored: BIFF2 puts a 3-byte attribute field in every cell record, BIFF3 and BIFF4 refer to an XF (extended format) record by number.
Structure
Unlike BIFF5 and BIFF8, the file is not a compound file. It is the record stream
itself: a sequence of records, each a 2-byte type, a 2-byte length and the data, all
little-endian. The first record is a BOF record, whose type number tells the version
(0x0009 BIFF2, 0x0209 BIFF3, 0x0409 BIFF4), and
the last is an EOF record (0x000A). Between them come the settings of the
sheet, the fonts and number formats, the DIMENSION record (the used area), the row
records and the cell records (NUMBER, LABEL, BOOLERR, FORMULA and, in BIFF2, INTEGER;
in BIFF3 and BIFF4, RK).
The records page gives the field layouts of the cell records for each version.
Not described
Known, not yet covered
- Reference: the page setup records (headers, footers, margins, page breaks), the protection records, the Excel 4.0 macro sheet records and the BIFF2 to BIFF4 chart records. The records page lists their numbers; it gives the layouts of the cell, FONT, FORMAT, XF, STYLE, PALETTE, column, WINDOW2 and name records, the formula token sizes and the workspace records.
- Viewer: BIFF2 to BIFF4 sheets and the BIFF4 workspace files
(
.xlw) open (cells, formulas, styles, names). Nine real files (BIFF2, BIFF3 and BIFF4 worksheets and two workspaces) are compared with LibreOffice’s CSV output; the differences are listed under Divergence below. Charts, drawings, page setup and macro sheets of these versions are not shown as such.
Unknown
- Reference: the record order of a BIFF4 worksheet stream: the OpenOffice.org description marks that section “2do”, so no source read for this page gives it.
Divergence from the specification
The specification used here is the OpenOffice.org description of the Excel file format (excelfileformat.txt); it does not give display rules for number formats. Where the viewer and LibreOffice Calc print different text for the same cell, the differences are these (details and file names on the records page):
- Booleans: the viewer prints TRUE and FALSE as stored in BOOLERR; LibreOffice’s CSV prints 1 and 0.
- Scientific formats:
0.E+00prints 1.E+03 in the viewer and 1E+03 in LibreOffice. - Padding with
_)-style characters: intestEXCEL_3.xlsthe viewer pads with 6 spaces and LibreOffice with 11. The viewer’s width table follows Apache POI’s; no source read for this site says which is right. - Fraction formats and a format section without a digit placeholder: see the records page.
- Workspace files use the fonts, formats and styles of the first sheet for every sheet.
Variants
- Excel 2.x, 3.0 and 4.0 worksheet (BIFF2 to BIFF4) – one sheet per file, a plain stream of records, single-byte text
- Excel 5.0 and 95 workbook (BIFF5) – BIFF records in a compound file’s Book stream, single-byte text
- Excel 97–2003 workbook (BIFF8) – BIFF records in a Workbook stream, with Unicode text and a shared string table
Links
Software
- LibreOffice Calc – free office suite’s spreadsheet, which imports BIFF2 to BIFF4 files (Windows, macOS, Linux)
- Microsoft Excel – Microsoft’s spreadsheet; recent versions refuse the oldest of these files (Windows, macOS)
Developers
- xlrd – library that reads BIFF2 to BIFF8 files (Python)
- Excel File Format – the OpenOffice.org description of BIFF2 to BIFF8 by Daniel Rentz (PDF)