Pivot tables are the most powerful feature in spreadsheets and the most fragile during format conversion. They're dynamic summaries — change the source data and the pivot updates; drag a field from rows to columns and the entire layout reflows. This dynamism is what makes them valuable and what makes them nearly impossible to preserve across formats.

When you export a workbook containing pivot tables, the critical question is: do you need the pivot's output (the summarized numbers) or the pivot's functionality (the ability to rearrange, filter, and drill down)? The answer determines your format choice, and getting it wrong means either losing interactivity you needed or carrying baggage you don't.

How Pivot Tables Are Stored in XLSX

An XLSX file stores pivot tables in two components:

  1. Pivot Cache (xl/pivotCache/): A complete copy of the source data at the time of the last refresh. This is why an XLSX file with pivot tables is often twice the size you'd expect — the raw data exists in both the source sheet and the pivot cache. The cache stores every unique value for each field, pre-processed for fast pivoting.
  2. Pivot Table Definition (xl/pivotTables/): The configuration — which fields are in rows, columns, values, and report filters; which aggregation function each value field uses (SUM, COUNT, AVERAGE, etc.); which items are expanded or collapsed; grand totals; subtotals; formatting; calculated fields; and grouping rules.

When you open a workbook and see a pivot table, Excel reads the definition, applies it to the cached data, and renders the result. The visible cells are computed on the fly from the cache and definition. This is why pivot tables can survive source data deletion — the cache has its own copy.

The cache is also why pivot tables make files large. A 5MB data source creates a ~5MB cache. Three pivots from the same source create three caches (unless you explicitly share the pivot cache in Excel, which few people do). A workbook with a 10MB dataset and 4 pivot tables can easily be 50MB+ because of redundant caches.

Exporting Pivots to CSV: Flattened Values Only

When you convert XLSX to CSV, pivot tables become flat values. The result looks like a regular table — rows and columns of numbers and labels — but with all pivot functionality stripped:

  • No rearranging fields. The layout is frozen in whatever state it was when exported.
  • No filtering. Report filters, slicers, and field item visibility are baked into the output. Hidden items are excluded.
  • No drill-down. Double-clicking a pivot value in Excel shows the underlying detail rows. In CSV, there's no underlying data — just the summary number.
  • No aggregation change. If the pivot shows SUM, you can't switch to AVERAGE or COUNT after export.
  • Merged cells become messy. Pivot tables often merge cells for row labels ("Q1" spans all Q1 months). In CSV, only the first row of the merged range has the value; the rest are empty. This creates gaps that break programmatic parsing.

The practical approach: if you know the pivot output will go to CSV, copy the pivot table, Paste Special as Values into a new sheet (removing merged cells), add explicit headers, and then export that sheet. This produces a clean, flat table without the artifacts of pivot formatting.

Exporting Pivots to PDF: Visual Snapshot

Converting XLSX to PDF renders the pivot table exactly as it appears on screen, including formatting, grand totals, and conditional formatting applied to pivot cells. The visual output is perfect, but the PDF is completely static — no filtering, no rearranging, no drill-down.

PDF is the right choice when:

  • The recipient needs to view the summary but not interact with it.
  • The formatting and layout must be preserved exactly (board reports, financial summaries).
  • You want to prevent modification of the numbers.

For large pivot tables that span multiple pages, set print areas and page breaks in Excel before exporting to PDF. Without explicit print settings, the PDF may split the pivot table at awkward points, separating row labels from their data.

Exporting Pivots to ODS: Partial Preservation

Converting XLSX to ODS partially preserves pivot table structure. LibreOffice Calc supports pivot tables (called "DataPilot" in older versions), so the ODS format can represent pivot configuration. However, the conversion isn't seamless:

  • Data source reference. If the pivot references a named range or table, the reference may not transfer correctly. Internal cell range references usually work.
  • Calculated fields. Custom formulas within the pivot (e.g., a calculated field for profit margin) may not convert or may produce errors.
  • Grouping. Date grouping (months, quarters, years) and numeric grouping (ranges) may not survive the conversion.
  • Formatting. Pivot styles, banded rows, and conditional formatting on pivot cells may change or disappear.
  • Refresh behavior. After conversion, try refreshing the pivot in LibreOffice Calc. If the source data connection is intact, it should refresh. If not, the cached data is all you have.

The recommendation: after converting to ODS, open in LibreOffice and manually verify each pivot table. If the pivot is critical, recreate it natively in LibreOffice rather than relying on the conversion.

Cross-Platform Pivot Compatibility

Pivot tables are implemented differently across the three major spreadsheet platforms:

FeatureExcel (XLSX)Google SheetsLibreOffice Calc (ODS)
Max source rows1,048,576~10 million cells1,048,576
Calculated fieldsYes (formulas)Yes (calculated fields)Limited
Calculated itemsYesNoNo
Grouping (date)Yes (days, months, quarters, years)Yes (limited)Yes (basic)
SlicersYesYes (since 2023)No
Timeline filtersYesNoNo
Multiple value fieldsYesYesYes
Shared pivot cacheYesN/A (cloud)No
OLAP connectionYesNoNo

Moving a pivot table between platforms is unreliable. The safest cross-platform strategy: share the source data and let each recipient build their own pivot natively. If you must share the pivot output, flatten it to values (Copy > Paste Special > Values) and share as a regular table in XLSX or CSV.

Alternatives to Pivot Tables for Cross-Format Data

If pivot table portability is a recurring problem, consider alternatives that produce the same summarized output without the format-dependency:

  • SQL GROUP BY. The most portable aggregation mechanism. SELECT category, SUM(revenue), COUNT(*) FROM sales GROUP BY category works in every database and produces flat output that survives any format. Convert your CSV to SQL, run the aggregation, and export the result.
  • pandas/polars groupby. df.groupby('category')['revenue'].agg(['sum', 'count']) produces a flat DataFrame. Export to XLSX or CSV.
  • DuckDB. Query CSV or Parquet files directly with SQL: SELECT category, SUM(revenue) FROM 'sales.csv' GROUP BY category. Produces flat output, no pivot machinery needed.
  • Google Sheets QUERY function. =QUERY(A1:D100, "SELECT A, SUM(D) GROUP BY A") produces flat output directly in cells. Survives export because the output is regular cell values (though the formula itself doesn't export to XLSX).

The pattern: use pivot tables for interactive exploration within one platform. When sharing results across platforms or formats, flatten to a static summary table. The summary loses interactivity but gains universal portability.

Pivot tables are inherently platform-bound. Their power comes from tight integration with the spreadsheet engine — cached data, live source connections, interactive rearrangement — and that integration can't be serialized into a simpler format. When you export a pivot table, you're always choosing between preserving the output (CSV, PDF) and preserving the mechanism (XLSX within Excel, with caveats for ODS and Google Sheets).

The practical rule: if the recipient needs to interact with the pivot (filter, drill down, rearrange), they need the original workbook in their native application. If they need the summary, flatten it to values and export in whatever format they prefer. Trying to preserve pivot functionality across platforms leads to broken files, incorrect results, and frustrated users.