Returns the result of a SQL query as an array. This is a CSE/Array formula so must be entered into a range at once using Ctrl+Shift+Enter.
This is the fastest way to return database results into Excel, but limits your options for altering the query.
XL3TableArrayLookup( Connection, Sql, [HeaderHandling] )
|Connection||Connection number to use|
|Sql||The query to run. Typically from a cell so that the query can be updated.|
|HeaderHandling|| Optional, how to output headers
Here we have our SQL statement in cell A1. We select the range we want to output the results to, and type
Then press Ctrl+Shift+Enter.
Note that any cells outside of the data area return #N/A. The date column has also been formatted.