Run SQL Queries on Excel Files
Query .xlsx and .xls spreadsheets with SQL — filter, group, and join sheets with DuckDB in your browser. No upload, no install, no database setup.
Excel is great for looking at data, but filtering, grouping and combining sheets quickly turns into a maze of formulas and pivot tables. In the SQL Playground every sheet of your workbook becomes its own table, so you can answer the question with one readable SQL query instead.
How it works
- Open the SQL Playground and drop your .xlsx or .xls file onto it.
- Each sheet is loaded as a separate table named after the sheet.
- Write a SELECT query, run it with Ctrl/Cmd+Enter, and export the result as CSV, JSON or Parquet.
Examples you can copy
Totals per region (like a pivot table)
SELECT region,
SUM(quantity * unit_price) AS revenue,
COUNT(*) AS orders
FROM orders
GROUP BY region
ORDER BY revenue DESC;
Combine two sheets with a lookup (instead of VLOOKUP)
SELECT o.order_id, c.name, c.country, o.product
FROM orders o
LEFT JOIN customers c USING (customer_id);
Filter rows like an Excel filter
SELECT *
FROM orders
WHERE region = 'North' AND order_date >= DATE '2026-02-01';
FAQ
Can I query an Excel file with SQL without installing anything?
Yes. The SQL Playground runs DuckDB inside your browser tab. Drop an .xlsx or .xls file and query it right away — there's nothing to install and no account to create.
Is my spreadsheet uploaded anywhere?
No. The workbook is read and queried on your own computer, inside the browser. It is never sent to a server.
How are sheets named?
Each sheet becomes a table named after the sheet. If a name contains spaces or symbols, wrap it in double quotes in your query, for example SELECT * FROM "Sales 2026".
Can I replace VLOOKUP or XLOOKUP with SQL?
Yes. A LEFT JOIN between two sheets on a shared column does the same job as VLOOKUP, works on every row at once, and doesn't break when columns move.
Can I save the result back to Excel?
Export the result as CSV and open it in Excel, or use the CSV to Excel tool to get an .xlsx file.
Open the SQL Playground
Explore the local data workbench · Browse all tools