How to Use Excel Query

by 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

1

Open the Excel worksheet into which you want to import data.

2

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.

3

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."

4

Choose "Table," "PivotTable Report" or "PivotChart and PivotTable Report" under "Select How You Want to View This Data in Your Workbook."

5

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

1

Open the worksheet into which you want to import data from a web page.

2

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.

3

Enter the address of the web page you want to query in the "Address" field and click "Go."

4

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.

5

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.

About the Author

Tricia Goss' credits include Fitness Plus, Good News Tucson and Layover Magazine. She is certified in Microsoft application and served as the newsletter editor for OfficeUsers.org. She has also contributed to The Dollar Stretcher, Life Tips and Childcare Magazine.

Photo Credits

  • photo_camera Ciaran Griffin/Stockbyte/Getty Images