# Write a spreadsheet

Publish / file

write Excel, Google Sheets

Page: <https://meridian.online/operations/write-a-spreadsheet>

## Status

Runs as a SQL step.

arcform carries it as a `sql:` step today, with the `excel` extension.

## The DuckDB step

write an .xlsx

It reads the `orders` table the proofs share. Create it first:

```sql
CREATE TABLE orders AS SELECT * FROM (VALUES
  (1,  'Alice Ng',      'north', DATE '2026-01-03', 120.00, 'widget', 'a|b',   '{"channel":"web","items":[1,2]}'),
  (2,  'alice ng',      'north', DATE '2026-01-05',  80.50, 'gadget', 'b',     '{"channel":"shop","items":[3]}'),
  (3,  'Bob  Okafor',   'south', DATE '2026-01-05', 300.00, 'widget', 'a|c',   '{"channel":"web","items":[4,5,6]}'),
  (4,  'Carla Díaz',    'east',  DATE '2026-01-09',  NULL,  'gizmo',  NULL,    '{"channel":"web","items":[]}'),
  (5,  'Bob Okafor',    'south', DATE '2026-01-12',  45.25, 'gadget', 'c',     '{"channel":"phone","items":[7]}'),
  (6,  'Dev Patel',     'west',  DATE '2026-01-12', 510.00, 'widget', 'a',     '{"channel":"web","items":[8,9]}'),
  (7,  'Carla Diaz',    'east',  DATE '2026-01-20',  99.99, 'gizmo',  'b|c',   '{"channel":"shop","items":[10]}'),
  (8,  'Dev Patel',     'west',  DATE '2026-02-02', 510.00, 'widget', 'a',     '{"channel":"web","items":[8,9]}'),
  (9,  'Eve Larsen',    NULL,    DATE '2026-02-03',  15.00, 'gadget', NULL,    '{"channel":"web","items":[11]}'),
  (10, 'Alice Ng',      'north', DATE '2026-02-10', 220.00, 'gizmo',  'a|b|c', '{"channel":"phone","items":[12,13]}')
) t(order_id, customer, region, order_date, amount, product, tags, meta);
```

Then run the statement:

```sql
INSTALL excel; LOAD excel;
COPY (SELECT region, sum(amount) AS total FROM orders GROUP BY region) TO '<your_scratch_dir>/summary.xlsx' (FORMAT xlsx, HEADER true);
CREATE TEMP TABLE result AS
SELECT count(*) AS n, round(sum(TRY_CAST(total AS DOUBLE)), 2) AS total FROM read_xlsx('<your_scratch_dir>/summary.xlsx', all_varchar = true);
SELECT * FROM result;
SELECT CASE WHEN ((SELECT n = 5 AND total = 1900.74 FROM result)) THEN 'as expected' ELSE error('the workbook written does not hold the five regional totals') END AS verdict;
```

Replace `<your_scratch_dir>` with a directory of your own that you can write to before running the statement.

The statement writes `summary.xlsx` itself, in `<your_scratch_dir>`.

It needs the `excel` extension.

## Variants

- Write sheets to a workbook: Write one or more tables to sheets of an Excel or OpenDocument workbook.
- [Write to an online spreadsheet](https://meridian.online/operations/write-a-spreadsheet/write-to-an-online-spreadsheet): Write a table to a spreadsheet held in a cloud service through its API.
- Update cells in an existing workbook: Overwrite chosen cells or ranges, or apply formatting, in a workbook that already exists.

## What other tools call it

Meridian's classification; an independent blind rating agreed on 86.2% of 312 rows (exact class, version 2).

- Alteryx Designer: [`Google Sheets Output`](https://help.alteryx.com/current/en/designer/tools/connectors/google-sheets-output-tool.html) (read 2026-09-27)
- Duckle: [`Excel (XLSX)`](https://github.com/slothflowlabs/duckle/blob/f85f8960edfb6efbf4cb89d58a7b32e16df0e867/website/docs/components.html) (read 2026-09-25)
- EasyMorph: [`Export into Excel file`](https://help.easymorph.com/doku.php?id=transformations:exportexcel) (read 2026-09-27)
- EasyMorph: [`Export into Google Sheets`](https://help.easymorph.com/doku.php?id=transformations:exportgooglesheets) (read 2026-09-27)
- Apache Hop: [`Excel writer`](https://hop.apache.org/manual/latest/pipeline/transforms/excelwriter.html) (read 2026-09-27)
- Apache Hop: [`Google Sheets output`](https://hop.apache.org/manual/latest/pipeline/transforms/google-sheets-output.html) (read 2026-09-27)
- KNIME Analytics Platform: [`Excel Cell Updater`](https://api.hub.knime.com/nodes/*pfKae1pgEo_UWX2K?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`Excel Writer`](https://api.hub.knime.com/nodes/*W7ZrYokRTpEckCe2?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`Google Sheets Appender`](https://api.hub.knime.com/nodes/*dClw0vmaM4zoM5sa?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`Google Sheets Updater`](https://api.hub.knime.com/nodes/*ffENCUEtNwhhpuNg?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`Google Sheets Writer`](https://api.hub.knime.com/nodes/*tORN7j1aLrofPiJ1?details=full) (read 2026-09-27)
- KNIME Analytics Platform: [`XLS Formatting & Utilities (extension)`](https://api.hub.knime.com/extensions/com.continental.knime.feature) (read 2026-09-27)
- OpenRefine: [`Excel spreadsheet (XLS or XLSX)`](https://openrefine.org/docs/manual/exporting#export-data) (read 2026-09-27)
- OpenRefine: [`Open Document Format (ODF) spreadsheet (ODS)`](https://openrefine.org/docs/manual/exporting#export-data) (read 2026-09-27)
- OpenRefine: [`Upload to Google Sheets`](https://openrefine.org/docs/manual/exporting#export-data) (read 2026-09-27)
- Pentaho Data Integration: [`Microsoft Excel Output`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Pentaho Data Integration: [`Microsoft Excel Writer`](https://docs.pentaho.com/pdia-data-integration/9.3-data-integration/pdi-transformation-steps-reference-overview) (read 2026-09-27)
- Polars: [`DataFrame.write_excel`](https://docs.pola.rs/api/python/stable/reference/io.html) (read 2026-09-27)
- RapidMiner Studio: [`Delete Google Sheets`](https://docs.rapidminer.com/latest/studio/operators/data_access/cloud_storage/google_sheets/google_sheets_remover.html) (read 2026-09-27)
- RapidMiner Studio: [`Update Excel`](https://docs.rapidminer.com/latest/studio/operators/extensions/Operator%20Toolbox/reporting/update_workbook.html) (read 2026-09-27)
- RapidMiner Studio: [`Write Excel`](https://docs.rapidminer.com/latest/studio/operators/data_access/files/write/write_excel.html) (read 2026-09-27)
- RapidMiner Studio: [`Write Google Sheets`](https://docs.rapidminer.com/latest/studio/operators/data_access/cloud_storage/google_sheets/google_sheets_writer.html) (read 2026-09-27)
- Tableau Prep: [`Microsoft Excel (.xlsx)`](https://help.tableau.com/current/prep/en-us/prep_save_share.htm) (read 2026-09-27)
- Talend: [`tFileOutputExcel`](https://help.qlik.com/talend/en-US/components/8.0/excel/excel-component) (read 2026-09-27)
- VisiData: [`gsheets (saver)`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/experimental/gsheets.py#L58) (read 2026-09-23)
- VisiData: [`xls (saver)`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/loaders/xlsx.py#L183) (read 2026-09-23)
- VisiData: [`xlsx (saver)`](https://github.com/saulpw/visidata/blob/7609212ec2febafa9caba7183cbebfaf49627909/visidata/loaders/xlsx.py#L139) (read 2026-09-23)
