Extracting data (data collection and update) automatically from a web page to your Excel worksheet might be important for some jobs. Excel gives you the opportunity to collect data from a web page. This is one of the most used Excel features for those who use Excel for their data analysis job. If you are working for a financial analyst company, you might need to get or import daily stock prices from a website to your Excel workbook for analysis. In this article, I will show you how to extract data from a website to excel automatically in easy steps.
Step by Step Procedures to Extract Data from Website to Excel Automatically
We will be using Excel’s From Web command in the Data ribbon to collect data from the web. For example, I want to collect data from this page. It is the webpage of the U.S Energy Information Administration showing the information on Petroleum prices.
Now, let us follow the steps below to extract this data into excel.
Step 1: Insert Web Address to Excel
In the beginning, we will provide the website information in excel.
- First, go to the Data tab and select From Web in the Get & Transform Data group.
- Then, insert the web URL in the From Web dialogue box.
- After that, press OK.
At this stage, we will proceed to the main part of extracting data. Let’s see how it works.
- First, you will see the Navigator window.
- Here, select the table from the Display Options.
- Along with it, you will see the preview in the Table View tab.
- Lastly, press on Load.
- That’s it, you have successfully extracted data from the website automatically.
Read More: How to Extract Data From Table Based on Multiple Criteria in Excel
Step 3: Apply Refresh All Command for Data Update
So now, as we have our data, we will need confirmation that it is linked to the website. Because we want regular updates in our excel file whenever there is an update on the website. So here is the solution.
- Simply go to the Data tab.
- Then click on Refresh All every time you want an update.
Step 4: Refresh Data Within Fixed Time Limit
Data update is more flexible with the Connection Properties tool. Follow the process below:
- First, go to the Data tab and select Refresh All.
- Here, choose Connection Properties from the drop-down menu.
- Following, you will see the Query Properties dialogue box.
- Here, you can adjust the time to decide when you want an update from the website in the Refresh Control section.
- After that, click on OK.
Read More: Excel VBA: Pull Data Automatically from a Website (2 Methods)
- How to Extract Data from Excel to Word (4 Ways)
- Transfer Data from One Excel Worksheet to Another Automatically
- How to Pull Values From Another Worksheet in Excel
- Importing Data into Excel (3 Suitable Ways)
- How to Extract Data from Excel Based on Criteria (5 Ways)
How to Edit Extracted Data Table in Excel
So now, as we have our final extracted data, you can see that there are some blank cells that confuse the readers. Here is a quick editing solution for this extracted data table.
- In the beginning, double-click on the table showing in the Queries & Connections panel.
- Then, in the new window, select Down from the Transform tab.
- As a result, it will create an option in the Applied Steps.
- Here, select the Changed Type step.
- Then, select Replace Values in the Transform group from the Home tab.
- After this, agree to Insert in the Insert Step dialogue box.
- Next, insert the Replace With value as null and keep the Value To Find box blank.
- Afterward, press OK.
- Now, select Filled Down as the Applied Steps.
- Finally, you will see the whole table without any blank cells.
- Lastly, change the table name from the Query Settings.
- Then, press Close & Load.
- That’s it, here is the final output.
Read More: How to Extract Data from Excel Sheet (6 Effective Methods)
Things to Remember
The web page must have data in collectible formats like Table or Pre-data format. Otherwise, it would be another battle to convert it to a readable or excel-table format. You see, the Text to columns feature isn’t always your best friend.
So, this was a complete guideline for you on how to extract data from a website to excel automatically with easy steps. Let us know your insightful suggestions in the comment box. Follow ExcelDemy for more articles.
- How to Convert Text File to Excel Automatically (3 Suitable Ways)
- Extract Filtered Data in Excel to Another Sheet (4 Methods)
- How to Import Data from Secure Website to Excel (With Quick Steps)
- Import Data from Excel into Word Automatically Using VBA (2 Ways)
- How to Extract Data from a List Using Excel Formula (5 Methods)
- Excel Macro: Extract Data from Multiple Excel Files (4 Methods)
- How to Extract Data from Cell in Excel (5 Methods)
is the data in the web page is not highlighted with the yellow arrow, how do I download the data??
thank you! just one question, what if we want to keep record of these data for a year?
You have to use VBA or you can use Power Query.
how to use chrome instead of ie to fetch data in web query
We shall cover this topic soon.
This works for windows Excel but not mac Excel. How do you do for mac Excel 2016
following for answer
Hi, I’ve exact opposite condition. How can I do? Excel to website using PHP.
Very useful, I had this question in mind but never had the patience to search ( never wanted to either, necessity is the mother of all invention),now, when i searched I hit the jackpot in the first link that popped up in google search. What I searched for “how to show values from a website in a excel”. Thanks EXCELDEMY.com!!
Thanks for your nice words.
Thanks for finally writing about > How to Pull/Extract Data from a Website into Excel Automatically?
< Loved it!
I accessed the Google finance site in terms of your first screen print, however I cannot see any yellow squares with a red arrow to select any section of the page. Do have to turn on something to see these, I am using Excel 2019 Professional Plus version, on Windows 10 Professional 64 bit. I checked another web site, and also cannot see the yellow square. What do I have to turn on in Excel to be able see these ?
You can see that yellow square with a red arrow in Microsoft Office Professional Plus 2016. In Excel 2019, you won’t find that because there’s no need to use the yellow box. Excel will automatically detect all the tables and make a list of ’em. All you need to do is, simply select any of the tables that you want to import and then load them directly into your Excel worksheet.
What would be the best way to do the opposite – that is pull data from an excel worksheet into a website?
Hi, you mentioned how to export web data when the data is already in table-format. How would I do this when the data is not in table-format. Thank you!
If there’s no data table on a web page, Excel will import a default document data table into the worksheet. The document table is basically a null data table.
How can I pull just the emails into an excel sheet without the name, address, phone etc. if they are not set up in a list. Does a program like that exist? I don’t want to have to copy and past each one! Thank you!
Follow this tutorial to fetch all the data tables from a web page. After selecting a particular data table, click on the Transform Data command to modify your data table in the Power Query Editor. There you can remove all the unnecessary columns and keep your desired data. Then hit the Close & Load button to bring the transformed data table into your worksheet.
Wonderfull content thanks for sharing
Thanks for your nice words!