In this post we’re going to explore how to pull data from a table on a webpage into Excel. In our example we are going to pull stock price data from Google Finance for a given company. As this type of data is updated frequently (ie the market value of a stock changes almost continuously), we would want any importing solution to be able to refresh our data easily with the push of a button. Power Query will allow us to do just that once we set up our query.

For our example we’re going to pull the historical share prices for Apple Inc. These can be found here:

https://www.google.com/finance/historical?q=NASDAQ%3AAAPL

 

Step-001-How-To-Import-A-Table-From-A-Website-Using-Power-Query How To Import A Table From A Website Using Power Query

 

We are going to import this entire table into Excel using Power Query. Power Query makes this type of data grabbing very easy, quick and painless.

 

Step-002-How-To-Import-A-Table-From-A-Website-Using-Power-Query How To Import A Table From A Website Using Power Query

 

To import the data:

  1. Go to the Power Query tab.
  2. Then in the Get External Data section click the From Web.
  3. Enter the URL which you’re trying to import your table from.
  4. Click the OK button.

 

Step-003-How-To-Import-A-Table-From-A-Website-Using-Power-Query How To Import A Table From A Website Using Power Query

 

In the Navigator window:

  1. Select your table.
  2. Select the Table View tab.
  3. Check the data in the pane below is what you’re trying to import.
  4. Click the Load button.

 

Step-004-How-To-Import-A-Table-From-A-Website-Using-Power-Query How To Import A Table From A Website Using Power Query

 

Now the data will appear in your sheet. If you need to refresh the data all you need to do is go to the Data tab and hit the Refresh button.

  1. Your data.
  2. To refresh the data, go to the Data tab.
  3. In the Connections area, click the Refresh button.