Skip to main content

Excel

Excel workbooks can be loaded through DuckDB's Excel extension and stored in MotherDuck for repeatable SQL analysis.

note

Excel files load through a DuckDB client using read_xlsx (shown below). The MotherDuck UI Add data uploader supports CSV, Parquet, and JSON, but not .xlsx. To load an Excel file, use the DuckDB CLI or another DuckDB client, or convert the file to CSV first.

How it works with MotherDuck

  1. Connect to MotherDuck from a DuckDB client.
  2. Install and load the DuckDB Excel extension in the client session.
  3. Use read_xlsx to read a workbook and create a MotherDuck table from the result.

Example

INSTALL excel;
LOAD excel;

CREATE TABLE my_table AS
SELECT *
FROM read_xlsx('workbook.xlsx');

To read a specific worksheet, pass the sheet parameter:

CREATE OR REPLACE TABLE my_database.main.excel_data AS
SELECT *
FROM read_xlsx('workbook.xlsx', sheet = 'Sheet1');