SQLookup

3 min read Original article ↗

SQLookup is an Excel add-in that gives you access to the SQLOOKUP function. The SQLOOKUP function allows you to query data in your Excel workbook using SQL (SQLite dialect). The add-in is free and works with Excel on Windows, macOS, and web. It can be installed via the add-in store. Here's how the formula works:


=SQLOOKUP(
  query,
  [alias a], table a,
  [alias b], table b,
  ...
  [parse_dates]
)
      
  • query is a string with your select statement, e.g., "SELECT * FROM orders".
  • alias x [optional] represents the alias/name of the table that's referred to in the next argument (this is similar to how the LET formula works). If left away, the first table will be called a, the second one b, etc.
  • table x is a reference to a cell range or Excel table, e.g., A1:C20 or Table1[#All].
  • parse_dates [optional] specifies which columns should be interpreted as date/time values. Enter the column names as a comma-separated string, e.g., "date,_at". You can also enter parts of the columns names, e.g., "date", will transform the columns updated_date, as_of_date, etc.
  • NULL: empty cells are interpreted as NULL and vice versa.
  • Escaping: if your column names use spaces, wrap them in square brackets like so: "SELECT [user id] FROM a".

Note that you don't need to enter empty arguments when skipping over an optional argument. Hence, the simplest possible example is:


=SQLOOKUP("SELECT * FROM a", A1:B10)
      

Built with xlwings Wasm

xlwings Wasm logo

This is a showcase app for xlwings Wasm. xlwings Wasm allows you to create modern Excel add-ins in Python instead of JavaScript. It runs Python locally in the browser engine that powers Office.js add-ins. Installing Python isn't required—neither on end users' computers nor on the server. In a little more detail, xlwings Wasm is based on Pyodide, which is a Python distribution for WebAssembly (Wasm). WebAssembly is a technology that allows running programming languages like Python directly in web browsers at near-native speed. For more info see the xlwings Wasm documentation.

Screenshot

SQLookup formula

Privacy Policy

SQLookup is 100% privacy-focused:

  • All processing happens locally on your machine
  • No data is transmitted externally
  • No usage statistics are collected except for those that Microsoft collects for every published add-in.
  • Self-hosting options are available via anything that can host a static website:
    • nginx, Apache, etc.
    • GitHub Pages, Cloudflare Pages
    • S3 Buckets
    • etc.

Contact

For self-hosting and other inquiries, contact us.

Licenses

EULA

See End-User License Agreement