What Would Markdown for Spreadsheets Look Like?
2 min readRitij Jain

I wanted to open a spreadsheet in a text editor and see what had changed. If a total moved, I wanted to know whether someone edited the inputs or rewrote the formula.
A spreadsheet in layers#
My first sketch used a few CSV-like files per sheet. I'd keep the numbers and the last calculated results in one file, formulas in another, and formatting in separate files.
CSV and Markdown tables gave me a readable list of values. I still needed a way to represent formulas that refer to other sheets and formatting that tells me whether a number is a percentage or a dollar amount. The sketch started to look like a spreadsheet format of its own.
Then I looked at XLSX#
An ordinary, unencrypted .xlsx file is a ZIP package containing XML files and other parts. You can inspect it with a ZIP utility.
A workbook might contain parts such as:
[Content_Types].xml
_rels/.rels
xl/workbook.xml
xl/worksheets/sheet1.xml
xl/styles.xml
xl/sharedStrings.xmlThe exact contents vary, but the basic idea was familiar: a workbook assembled from smaller pieces, with worksheet data, styles, and relationships represented explicitly.
The part that surprised me was seeing the formula and its last calculated result right next to each other. A simplified worksheet cell can look like this:
<c r="B3">
<f>SUM(B1:B2)</f>
<v>30</v>
</c>In my sketch, those were in different files. Here they fit in one cell. The cached value can be missing or out of date, and a tool that reads the file may leave the formula unevaluated.
Microsoft's SpreadsheetML documentation describes the parts, and its formula documentation explains how the cached value works.
The file format underneath Excel#
I had mentally grouped Excel, XLSX, and proprietary software together.
Excel is Microsoft's proprietary application. XLSX belongs to Office Open XML, a format family standardized through ECMA-376 and ISO/IEC 29500. The older .xls format is a different thing.
An open specification doesn't guarantee effortless compatibility. Microsoft's own implementation notes document places where Office varies from or extends the specification. Reading cell values is also a much smaller job than reproducing a workbook's calculations and appearance.
What I still want from a workbook diff#
Markdown is useful partly because I can comfortably write and review its source. A ZIP package full of XML does not offer the same experience. Unzipping a workbook makes it inspectable, but doesn't automatically produce a useful Git diff or an easy hand-editing workflow.
I'd start with a tool that displays changes to cell values, formulas, and formatting in a form I can read. Writing edits back is a larger job. Inserting a row can change what a formula refers to, and editing a formula can leave its last calculated result out of date.
What I still want is a workbook diff I can read. If someone changed the formula in B3, I'd like to see the old formula and the new one without digging through a ZIP file.
Related posts
Comments
No account is required; choose a display name to join the discussion.
Comments load as you approach this section.