How to Use Excel Queryby Tricia Goss
Many types of external sources may contain data from which your Excel worksheet could benefit. Some sources include Microsoft Access database tables, other Excel files or web pages. Rather than wasting time copying and pasting data from other sources into your worksheet, you can use Excel's query feature to quickly locate and incorporate the information you need. The manner in which you do so depends on what you want to query and the version of Excel you are using.
Query a Database
Open the Excel worksheet into which you want to import data.
In Excel 2003, go to the "Data" tab, point to "Import External Data" and select "New Database Query" to query a database. In Excel 2007 or 2010, go to the "Data" tab and select "From Access" in the "External Data" group.
Select the database you want to query and click "Open." Select the table in this database from which you want to import data and click "OK."
Choose "Table," "PivotTable Report" or "PivotChart and PivotTable Report" under "Select How You Want to View This Data in Your Workbook."
Enter a range of cells in the current worksheet and click "OK." The query will import the database table you selected into the current worksheet.
Query a Web Page
Open the worksheet into which you want to import data from a web page.
In Excel 2003, go to the "Data" menu, point to "Import External Data" and select "New Web Query." In Excel 2007 or 2010, go to the "Data" tab and click on "From Web" in the "Get External Data" group. The "New Web Query" dialog box will open.
Enter the address of the web page you want to query in the "Address" field and click "Go."
Click the arrow next to the table you want to import. If you do not see arrows, click the "Show Icons" button on the "New Web Query" toolbar. To import several tables, simply click the arrow next to each one.
Click "Import." Enter the range in the current worksheet where you want to place the data. Click "OK." The query will import the table or tables you selected into the current worksheet.
- photo_camera Ciaran Griffin/Stockbyte/Getty Images