A spreadsheet with Excel 2007’s files, tables and functions, written from scratch in C on GTK 4, Pango and Cairo and held to Gnumeric’s standard of correctness. A grid, a formula bar, a name box, two toolbars and sheet tabs along the bottom: Excel without the ribbon.

The sister project of Word42, built on the same principles: a small, honest codebase that does one thing well. Numbers42 is its other name, and means the same program.

Get it View on GitHub

Office42 Spreadsheet 1.0.2 showing the dashboard of a set of accounts: a title set in two fonts in one cell, a strip of four merged key figures — revenue, gross margin, operating profit and cash — over a quarterly table in the Accounting number format, an operating margin row with a conditional format on the weakest quarter and a note attached, the formula bar showing the cross-sheet formula =Profit!B8, a column chart of revenue and operating profit by quarter with its axis in thousands, a pie chart of operating expenses with labels and a legend, and seven coloured sheet tabs — Dashboard, Profit, Balance, Cashflow, Trial, Journal and Accounts
A year of a trading company's accounts on seven sheets, every figure drawn from one journal: this is the dashboard, with a cross-sheet formula in the formula bar.
637functions, every one Excel 2007 has but the cube functions, and Gnumeric's own besides
16,777,216 × 16,384rows by columns, sixteen times Excel 2007's rows, and an empty cell costs nothing
17kinds of chart, in two or three dimensions
3platforms built on every push: Linux, macOS and Windows

Excel 2007, without the ribbon

Excel 2007 changed the file, the size of the grid and a good deal of what a formula can say, and it brought the ribbon. Office42 takes the first three and leaves the ribbon out: a book made in Excel 2007 or any Excel since opens here, and saves back as .xlsx.

What Excel 2007 brought, and Office42 has

  • The .xlsx file, read and written, and the one a new book is saved as; an .xlsm keeps its Visual Basic for Excel
  • A grid bigger than Excel 2007's 1,048,576 rows by 16,384 columns, so any .xlsx comes in whole
  • Tables, with banded rows, filter buttons, a total row and structured references: =SUM(Sales[Qty]), =[@Qty]*[@Price]
  • IFERROR, SUMIFS, COUNTIFS, AVERAGEIF and AVERAGEIFS, and the Analysis ToolPak's functions built in, as Excel 2007 made them
  • Function names offered as a formula is typed, as Formula AutoComplete offers them
  • Conditional formats with as many rules to a range as you need; colour scales from an .xlsx drawn and kept, and its top-ten, above-average and duplicate rules read as the formulas that say the same
  • Theme colours in an .xlsx, tinted as Excel tints them
  • The Good, Bad and Neutral cell styles, Title and the headings, and Data ▸ Remove Duplicates

What it leaves out

  • The ribbon and the Office button, by choice: the menus and toolbars reach everything
  • Data bars and icon sets, which are not there yet
  • The seven CUBE functions, which ask an OLAP server
  • SmartArt, and themes as something to apply
  • Sorting by more than three keys, and filtering by colour

Later Excels are drawn on as well: dynamic arrays that spill, XLOOKUP, LET and LAMBDA, and the text-splitting and regular-expression functions of Excel 365.

docs/PARITY.md keeps the score, and says what is missing and why.

What it does

A working spreadsheet, not a demo. Everything below ships today, and docs/PARITY.md keeps an honest score, area by area, of what is there and what is missing.

The window

  • Excel's keys: Enter steps down, Tab steps right, Tab-Tab-Enter returns to the column the row began in
  • The formula bar is the same edit as the cell, every reference in its own colour
  • Function names offered as you type, and the signature of the call the caret is in
  • Point mode, F4 on the dollars, the fill handle, drag-and-drop, AutoComplete and AutoCorrect
  • Edit ▸ Fill up, left, a series, justified text and across worksheets; Move or Copy Sheet
  • Zoom, freeze and split panes, custom views, a second window on the same book
  • Undo of everything, deleting a sheet included

Formatting

  • Excel's Format Cells dialog, with its six tabs
  • Number formats in Excel's own code language: #,##0.00;[Red](#,##0.00), [h]:mm, and the Accounting format
  • Rich text with several fonts in one cell
  • Borders of every style and colour, Excel's eighteen patterns, indent, rotation, shrink to fit, merged cells
  • Named cell styles, Good, Bad and Neutral among them, that restyle every cell wearing them
  • Conditional formats, as many rules to a range as you need, formulas and colour scales among them
  • Tab colours, sheet backgrounds, hidden sheets
  • Formats are interned, so a thousand bold cells share one record

Formulas

  • Excel's precedence, A1 and $A$1, whole rows and columns, 3-D references, the union, the intersection and @
  • Names defined, pasted, created from a table's labels and applied; structured references into tables
  • Array constants, LET, and LAMBDA kept under a name
  • Array formulas with Ctrl+Shift+Enter, and dynamic arrays that spill
  • Demand-driven recalculation with dirty flags; circular references reported, or gone round when asked
  • Trace precedents, dependents and errors, Evaluate Formula a step at a time, a Watch Window, and the green corner on a cell the error checking doubts

Functions

  • 637 of them: every one Excel 2007 has but the seven that ask an OLAP cube, and the Excel 365 text, array and regular-expression functions
  • Statistics in two passes so they are accurate; the distributions on regularised incomplete gamma and beta functions
  • Bond arithmetic on the five day-count bases, and the .INTL dates
  • Gnumeric's functions that Excel leaves out: the complex functions, twenty-eight random distributions, number theory
  • FOURIER, HPFILTER, INTERPOLATION, PERIODOGRAM, the movable feasts, the Hebrew calendar, and Black and Scholes with its Greeks

Charts

  • Column, bar, line, area, pie, doughnut, radar, bubble, stock, surface, box and whiskers, histogram, polar, contour and XY scatter
  • Pie of pie and bar of pie
  • Trendlines, error bars, markers or a picture at each point, a second value axis, chart sheets
  • Redrawn from the cells every time they are painted

Pictures and shapes

  • Pictures from a file, or from the scanner or the camera; cropped, with brightness and contrast
  • Excel's AutoShapes — stars, block arrows, callouts, flowchart symbols — and freeforms drawn point by point
  • Gradient and pattern fills, shadows, dashed lines and a head of any kind at either end
  • Turned to any angle and mirrored, grouped, ordered, and moving and sizing with the cells under them
  • Notes, hyperlinks, and the nine form controls of Excel's Forms toolbar, each bound to a cell

Data

  • Sort, the data form, Find and Replace, AutoFilter and Advanced Filter, Remove Duplicates
  • Text to Columns, at a separator or at fixed widths on a ruler
  • Validation with an input message, Excel's three error styles and circles round what breaks the rule
  • Subtotals, an outline worked out from the sums, Consolidate, Tables
  • Pivot Tables with calculated fields, page filters, and dates grouped by years and quarters
  • What-If tables that stay live, Scenarios with a summary sheet, Goal Seek, and a Solver that takes whole numbers and writes its report
  • The statistical analysis tools: descriptive statistics to moving averages

Money and dates

  • The Accounting format, with the symbol at one edge and the number at the other
  • The machine's currency, or the one Options is told, and Format Cells offers the rest
  • EUROCONVERT and Tools ▸ Euro Conversion, at the rates the euro's members fixed
  • The 1904 date system, precision as displayed, and a fixed decimal for what is typed
  • Templates an accountant would reach for: a loan schedule, an invoice, an expense report, a balance sheet
  • The Conditional Sum and Lookup wizards

Files

  • Gnumeric's .gnumeric, which carries everything
  • Excel 2007's .xlsx, the Strict form too, and the older .xls, with formulas, styles, charts, shapes, tables, names and notes, opening in Excel, LibreOffice and Gnumeric
  • An .xlsm keeps its Visual Basic for Excel
  • OpenDocument .ods and .fods, checked against LibreOffice both ways
  • HTML, CSV, DIF, SYLK, LaTeX and Lotus 1-2-3; PDF out and in
  • A big book reads in seconds; the zip and OLE2 containers are a few hundred lines each, and no library was added

Printing

  • Page Setup with Excel's four tabs, kept in every file format
  • Headers and footers in Excel's notation, and its Custom Header and Custom Footer dialog
  • Several print areas, and rows and columns repeated on every page
  • Page Break Preview with breaks to drag, and a print preview whose margins drag too
  • PDF of the sheet or the book, drawn exactly as the printer would

Automation

  • Python instead of Visual Basic: a console with book and sheet bound
  • The Macros dialog on Alt+F8, shortcuts on Ctrl+Shift+letter, and a recorder that writes Python
  • Scripts kept in the file, a step debugger, and events for a change, a selection, opening, closing and saving
  • =PY("expression") in a cell; functions defined in Python appear in the Function Wizard
  • A book that arrives with scripts offers to run them and never runs them by itself
  • A SQLite database beside the book or inside it, asked from Data ▸ Get Data or =SQLVALUE(...)

The terminal

  • office42-calc drives the whole engine from standard input
  • The model and the formula engine never include GTK, so the engine builds as a library of its own
  • office42 --screenshot renders the window to a PNG with nobody at the keyboard; the picture above was taken that way
  • One smoke test that the three platforms' builds all run
  • Spelling with Hunspell

How it works

The sheet is sparse: cells live in a hash table keyed by a packed row and column, and an empty cell costs nothing. Formulas are parsed once and kept as trees. Each formula cell records the rectangles it reads; when a cell changes the sheet marks stale every formula whose rectangles contain it, and theirs in turn, and nothing is recomputed until something asks.

The evaluator does not know what a sheet is. It reads values through a callback, which is why the engine builds as a library of its own and can be driven from a terminal:

$ ./builddir/src/office42-calc
A1 = 10
A2 = 20
B1 = =SUM(A1:A2)*2
B1
B1      60      (=SUM(A1:A2)*2)
dump
      A             B
1     10            60
2     20

Six layers, each of which may only see the ones below it. formula/ never includes model/, and neither includes GTK. Those two rules are the whole architecture.

src/util/      cell addresses, values, number formats, dates
src/model/     the sheet, the book, charts, shapes, undo
src/formula/   the parser, the evaluator, the function library
src/io/        .gnumeric, .xlsx, .xls, .ods, CSV and the rest, PDF, SQLite
src/script/    Python: the office42 module, the interpreter
src/ui/        the grid, the window, the dialogs
src/main.c        the window's entry point
src/calc-main.c   the terminal front-end
data/          menus, icons, stylesheet
docs/          the guide, the architecture, the parity review

docs/ARCHITECTURE.md goes into detail.

Two programs to aim at

Microsoft Excel 2007

For what a spreadsheet should hold and which files it should share. Excel 2007 brought the .xlsx file, a grid of a million rows, tables, IFERROR and the SUMIFS family, and conditional formats of more than three rules, and every Excel since has built on them. A book from any of them should open here and work.

The window keeps the shape Excel had before the ribbon: a menu bar, two toolbars, a formula bar, a name box and sheet tabs along the bottom, and the menus and dialogs of Excel 97, command for command. Later Excels are drawn on where they got something right: dynamic arrays, XLOOKUP, LET and LAMBDA.

Gnumeric

For how to do it right. Gnumeric was built by people who cared about numerical correctness more than about features, and that is the standard the arithmetic is held to. Its grid of 16,777,216 rows is this one's too.

Not planned: the ribbon, Visual Basic, co-authoring, Power Query and the Quattro Pro and Applix formats. docs/ROADMAP.md says why.

Get Office42

Version 1.0.2, released 21 September 2026; the release notes are on GitHub. On Windows it is in the Microsoft Store; on Linux, macOS and Windows it builds from source, and every push to main is built and smoke-tested on all three.

Building

Office42 needs a C11 compiler, Meson, Ninja, and GTK 4.10 or newer with Pango, Cairo and gdk-pixbuf. Python, Hunspell, SQLite and poppler-glib are used if they are there.

git clone https://github.com/office-42/office42.git
cd office42
meson setup builddir
meson compile -C builddir
./builddir/src/office42        # the window
./builddir/src/office42-calc   # the engine, from a terminal

sh build-aux/smoke-test.sh builddir/src/office42-calc puts the engine through its paces afterwards: formulas, recalculation, undo, the five file formats, Python and the database.

Per-platform dependency lists are the same as Word42's; see its docs/BUILD.md. The toolbar icons are SVG, so gdk-pixbuf wants its SVG loader at run time (librsvg2-common on Debian and Ubuntu).

Windows

Get it from the Microsoft Store

The Store package is made from the same source on every push; docs/WINDOWS-STORE.md has the procedure.

Continuous builds

The Linux, macOS and Windows workflows build every push and run the same smoke test, and the Linux and Windows builds treat a warning as an error; Linux builds on the newest Ubuntu GitHub keeps. The Windows job also makes a bundle that runs without MSYS2, smoke-tests it again, and uploads it and the Store package made from it as artifacts of each run.

Sample books

The repository's samples/ folder holds books that exercise the formats and the function library in .xlsx, .xls and .fods, and two that office42 writes itself from office42-calc scripts: an income statement, and the year of accounts in the picture above. Nothing in the accounts is typed twice, and four of its sheets end in a line that says in words whether the sums still tie up.

Source on GitHub

Documentation

The user guide

Every menu, every dialog, the number-format codes, the keyboard and the terminal front-end.

The parity review

A review of the code, module by module, and an honest score, area by area, of what is there and what is missing.

Architecture

The layers, the sparse sheet, the dependency graph, interned formats and the undo records.

Python

The console, the office42 module, events, the step debugger, the macro recorder and =PY().

The database

A SQLite database beside the book or inside it, and how a cell asks it a question.

Roadmap

What is left, in the order it is being done, and what is not planned and why.

The sister project: Word42

Word42 is a classic word processor, written from scratch in C on GTK 4, Pango and Cairo: a menu bar, two toolbars, a ruler, a status bar and a page. Inspired by classic Microsoft Word and by AbiWord, on a modern text stack. Office42 is built on the same principles, shares its build recipe and its platform lists, and borrows its interned formatting and symmetric undo records.

word42.org · github.com/office-42/word42