Importing data lists from the Web

It is often necessary to collect data from web-based sources due to updates and other modifications. An example of a web-based data list would be a list of currency conversion amounts. It is possible to go to the Web, find the currency that you need and to record the information manually; however, due to daily updates and multiple currency conversions, the process can be costly and time-consuming.

In this recipe, you will learn how to import data from the Web. While the steps used to perform this data import are native to Excel, this recipe has been included within the building on section due to the external use of data and the new functionality of this process within Excel 2007 and Excel 2010.

How to do it...

We will begin in the worksheet that you plan to use for the data import:

  1. Using the Excel toolbar go to Data | Get External Data | From Web:
    How to do it...

    The window that opens will be similar to the Internet Explorer internet browser.

  2. In the address bar, enter the web address of the location of the data that you wish to import. In this instance the address is http://moneycentral.msn.com/investor/market/exchangerates.aspx for the MSN currency chart; then click on Go...
    How to do it...
  3. Scroll down within the browser window to the beginning of the currency table:
    How to do it...

    You will see a yellow arrow just above the data table to be imported.

    Note

    Excel automatically recognizes the data tables within the websites that are available for import. If the site you wish to import does not have a recognized data table, it is still possible to download the entire page and strip the data from the import.

  4. Click on the yellow arrow for the currency rates table, and click on Import:
    How to do it...
  5. In the import data window that appears, ensure the data will begin in the cell you have designated, in this case A1, and then click on Properties.
  6. In the properties window, select the refresh checkbox and set the refresh to occur every 60 minutes.

    This will allow our data sheet to remain current with any updates that may occur.

  7. Click on OK.
    How to do it...

Excel has now added the data table of the currency rates to the Excel worksheet, where we can use formulas to update the other data. The data imported will also refresh every 60 minutes to ensure that our data is always accurate and reflects the latest changes.

How to do it...

How it works...

Excel utilizes a web query to gather information from data sources over the Internet. When setting the query, we pointed the Excel browser to the Internet's location that contained the data we wished to import, and Excel recognized the HTML code denoting a table within the page.

Setting the refresh to 60 minutes allows continuous updates of the data and ensures accurate formulas. Excel then imports the HTML table into Excel, and strips away all of the HTML code that makes the information viewable over the Internet.

There's more...

This type of web query is only effective with static tables of data. Web-based code allows for data tables that are representations of data lists and are not static updates. Excel will not be able to gather the non-static information.

A helpful suggestion

Linking a web query to a financial institutions transaction list would allow the importing of financial transactions for real-time data analysis of the transactions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.6.185