Tables, time series and transactional data
Messy Multi-Table Spreadsheets for Table Detection and Normalization
Quick answer
A useful messy spreadsheet dataset is a set of native .xlsx or .xls workbooks, kept with their formatting, merged ranges and formulas intact, that real people built for operational work, paired with labels for table regions, header rows and header hierarchy, totals, notes and blank separators, plus a normalized relational target for each detected table. Public corpora built from forums or synthetic grids under-represent the layouts that break ingestion pipelines, so real business workbooks and careful labeling matter more than raw volume.
By SourceX Editorial · Updated
Why real workbooks break table detectors
Real-world sheets are rarely one clean table starting at A1, and the published numbers show it. In SpreadsheetBench, which collected tasks and files from real Excel forum questions, 35.7% of sheets contained multiple tables and 42.7% contained non-standard relational tables [1]. Business workbooks exported from ERPs, maintained by finance teams or assembled for monthly reporting tend to be messier still, because they mix input blocks, pivot outputs, commentary and print layouts on one tab.
The failure modes are concrete. A detector trained on single-table CSV-like grids will merge two side-by-side tables into one wide table, treat a title row in A1 as a header, read a "Total" row as a data record, or split one table at a blank spacer row. LLM-based ingestion fails in parallel ways: serializing every cell address, value and format of a large sheet quickly exhausts a context window, while naive compression drops the formatting cues that separate one table from the next.
What a messy spreadsheet corpus has to contain
The corpus should be selected for layout variety, not row count. A thousand workbooks that each show different structural irregularities train and test a detector better than a million rows from one clean export. Ask for, or build toward, coverage of these irregularities:
- Multiple tables per sheet: stacked vertically with blank rows between them, side by side with a blank column gutter, or touching with no gutter at all.
- Merged and hierarchical headers: two- and three-level column headers built from merged ranges (for example a "2025" span over "Q1 to Q4"), and row headers indented by whitespace or outline level rather than separate columns.
- Pivot and crosstab outputs: Excel PivotTable output, months as columns, repeated row labels left blank under a group heading.
- Totals and subtotals: rows labeled "Total", "Subtotal" or "Grand total", often in bold, often driven by SUM or SUBTOTAL formulas.
- Notes and metadata blocks: report titles, "Prepared by" lines, as-of dates, footnote markers such as asterisks, and free-text comments below or beside tables.
- Mixed types and units in a column: numbers stored as text, "n/a" and dashes in numeric columns, currency and percentage formats, units carried in a header rather than in cells.
- Hidden and grouped content: hidden rows or columns, outline groups, very wide sheets, and multi-tab workbooks where tables continue across tabs.
Keep the native file. Converting to CSV discards merged ranges, number formats, bold and border styling, cell comments and formulas, which are exactly the signals a detector uses. Cell-level features such as value type, number format, bold, borders and fill are what let a detector treat the grid as structure rather than as a stream of text. If you need a lighter format for training, derive it from the native file with a library such as openpyxl and keep the original as the source of truth.
Labels for detection, header inference and normalization
Each task needs its own label layer, and the layers should share cell coordinates so they can be checked against one another. Table detection needs a bounding range per table in A1 notation (sheet name plus top-left and bottom-right cell). Header inference needs the header rows and columns within that range, their nesting depth, and how merged cells expand. Normalization needs a target table: typed columns, one record per row, with header hierarchies flattened into column names or unpivoted into key columns.
Useful label types, in rough order of importance:
- Table region, with a table ID and an orientation flag (row-major or transposed).
- Header rows and header columns, with hierarchy level per header cell.
- Aggregate rows and columns (total, subtotal), so they can be excluded from records or kept as checks.
- Non-table regions: titles, notes, footnotes, signatures and free text.
- Column types and units after normalization (date, currency with ISO 4217 code, percent, integer, text).
- Cross-table links, such as a summary table that totals a detail table on the same sheet or another tab.
Boundary precision matters more than people expect. Spreadsheet table detection is commonly scored with tolerance-based boundary metrics (e.g., TableSense's Error-of-Boundary [5]) that accept only small misalignments at table edges. Decide your tolerance before labeling, because an off-by-one header row produces a normalized table with a garbage first record.
An illustrative label record
A label file per sheet, stored as JSON next to the native workbook, keeps detection, header and normalization labels in one place.
Illustrative example: invented to show structure; it does not describe an available dataset.
{
"workbook_id": "wb_000417",
"sheet": "Q3 Summary",
"source_format": "xlsx",
"tables": [
{
"table_id": "t1",
"range": "B4:H19",
"orientation": "row_major",
"header_rows": [4, 5],
"header_hierarchy": {"C4:E4": "2025", "F4:H4": "2026"},
"row_header_cols": ["B"],
"aggregate_rows": [{"row": 19, "kind": "grand_total"}],
"excluded_rows": [{"row": 12, "kind": "blank_separator"}],
"notes_ref": ["n1"]
},
{
"table_id": "t2",
"range": "J4:L11",
"orientation": "row_major",
"header_range": "J4:L4",
"aggregate_rows": []
}
],
"non_table_regions": [
{"id": "title", "range": "B1:H2", "kind": "title"},
{"id": "n1", "range": "B21:H22", "kind": "footnote"}
],
"normalized_targets": {
"t1": {"file": "wb_000417__t1.parquet",
"columns": ["region", "year", "quarter", "revenue_usd"],
"unpivoted_from": "C5:H5"}
},
"annotator_ids": ["a03", "a11"],
"adjudicated": true
}
The normalized target is what makes the record useful for supervised normalization: the model sees the messy range and learns to emit the long-format Parquet or CSV, with years and quarters moved out of the header and the grand total excluded. Store the expected row count and a checksum of numeric totals so you can test that normalization preserved values.
Native spreadsheets versus tables in documents
Spreadsheet table detection is a different problem from table detection in PDFs and scanned pages, and the data should be specified differently. Document benchmarks such as TableBank label table regions in rendered pages [2], and frameworks such as GTE recover cell structure from visual context because cells are not explicit in an image [3]. In a native workbook every cell boundary, value, format and formula is already present; the hard part is semantic grouping, not pixel segmentation.
That changes what you license and label. Document work needs page images, bounding boxes in pixel coordinates and OCR text; spreadsheet work needs the native file, A1 ranges and header semantics. If your pipeline handles both, keep them as separate corpora with separate evaluation splits. For the document side, see document layout analysis datasets.
Labeling protocol and quality checks
Spreadsheet layout labels are ambiguous enough that double annotation and adjudication should be the default for evaluation splits. Two annotators will reasonably disagree on whether a two-row header is one hierarchical header or a title plus a header, or whether side-by-side blocks sharing a header are one table or two. Write the guideline for those edge cases before labeling, measure agreement on table ranges with an IoU threshold, and adjudicate disagreements; the annotation adjudication guide covers the options.
Audit the evaluation set separately. Even widely used benchmarks carry label error rates estimated at 3.3% or more on average, enough to reorder model rankings [4]. For spreadsheets, a cheap automated check is to recompute totals: if a labeled aggregate row does not equal the sum of the labeled data rows, either the label or the region boundary is likely wrong.
Split by workbook and by originating organization, not by sheet. Tabs from the same workbook share templates and styling, so a random sheet-level split leaks layout patterns into the test set and inflates detection scores.
Specifying a messy spreadsheet data request
A request that describes layouts and labels gets better matches than one that asks for "Excel files". This checklist translates the sections above into a specification.
Illustrative example: invented to show structure; it does not describe an available dataset.
| Field | Example specification |
|---|---|
| File format | Native .xlsx (and .xls where available), formatting, merged ranges, comments and formulas preserved |
| Workbook origin | Operational workbooks from finance, operations, sales reporting; no generated or template-only files |
| Layout coverage | At least 30% of sheets with 2+ tables; share with merged multi-level headers, pivot output, totals, notes |
| Labels | Table ranges (A1), header rows and hierarchy, aggregate rows, non-table regions, normalized target per table |
| Label quality | Double annotation on eval split, adjudicated, agreement reported; total-recompute check passed |
| Splits | By workbook and by source organization; held-out organizations for evaluation |
| Privacy | Names, emails, phone and account numbers removed or replaced in cells, comments and document properties |
| Delivery | Workbook files plus JSON labels and Parquet targets, with a manifest of hashes |
Check document properties and hidden content, not just visible cells. Author names, file paths, comments, hidden tabs and external link targets often carry personal or confidential details that a cell-level scrub misses.
How SourceX helps buyers source operational workbooks
SourceX sources operational datasets, including finance workflows and documents, from US companies on request, and manages licensing and ongoing purchases; categories describe what can be requested, not inventory, and a request does not guarantee a match. Buyers describe the workbooks and layouts they need, not the businesses, and every release is approved by the supplying company. Each dataset is rights-reviewed for ownership and consents, personal details such as names, emails, phone and account numbers are removed or replaced before delivery with the method recorded and a sample checked, though no method is perfect. You can describe the spreadsheet layouts your detector needs as a starting point.
For workbook licensing more broadly, see spreadsheet and financial model datasets and whether AI labs buy spreadsheets. Related buyer guides cover spreadsheet task benchmarks built from real workbooks, spreadsheet formula training data, table and spreadsheet retrieval data for RAG and the tabular data hub.
Source messy spreadsheets for table detection
SourceX sources operational workbooks from US companies on request for AI teams wherever they are based, and manages the process from assessing data and licensing permissions to agreeing allowed uses in a license. Nothing is contracted until a supplier agrees, and delivery runs through private, access-controlled workflows after an executed agreement. Describe the messy spreadsheets you need.
Frequently asked questions
Can synthetic spreadsheets replace real messy ones?
Synthetic generators are useful for pretraining boundary detection, but they reproduce only the irregularities their authors thought of. Real operational workbooks contain combinations, such as a pivot output with a footnote inside the range and a hidden total column, that generators rarely produce, so evaluation sets should be real.
Should I convert workbooks to CSV or Markdown before labeling?
No. Label on the native file and derive text serializations afterward. CSV and Markdown drop merged ranges, styling and formulas, so labels made on them cannot be mapped back to the source cells reliably.
How many workbooks do I need?
It depends on layout diversity rather than a fixed count. Active learning, where annotators label the sheets the current model is least certain about, is a reasonable way to spend a labeling budget on the layouts your model gets wrong.
Sources
- arXiv (Ma et al., NeurIPS 2024 Datasets and Benchmarks), "SpreadsheetBench: Towards Challenging Real World Spreadsheet Manipulation" (2024). https://arxiv.org/html/2406.14991v2
- arXiv (Li et al.), "TableBank: A Benchmark Dataset for Table Detection and Recognition" (2019). https://arxiv.org/pdf/1903.01949
- arXiv (Zheng, Burdick, Popa, Wang), "Global Table Extractor (GTE): A Framework for Joint Table Identification and Cell Structure Recognition Using Visual Context" (2020). https://arxiv.org/pdf/2005.00589
- arXiv (Northcutt, Athalye, Mueller; NeurIPS 2021), "Pervasive Label Errors in Test Sets Destabilize Machine Learning Benchmarks" (2021). https://arxiv.org/abs/2103.14749
- arXiv (Dong et al.), "TableSense: Spreadsheet Table Detection with Convolutional Neural Networks" (2021). https://arxiv.org/abs/2106.13500
Tell us what your models need
Share scope, volume, language, format, timing and licensing requirements.