Get the Web Query Practice Workbook
Both examples from this tutorial in one file: daily oil and fuel prices and a 7-day weather forecast with the umbrella column. Plus a Your Turn sheet so you can build both queries yourself.
Power Query lets you connect Excel to a data source, clean up the data, and load it as a table. The source can be a file, a database or a web page.
The best part comes later. When the source changes, you click Refresh and Excel pulls in the new data. Every cleanup step runs again on its own.
Think of it like a recorded macro, except Power Query writes the code for you. If you can click buttons, you can build this.
Import a Table from a Website with From Web
Heads-up: both websites in the video have changed since it was recorded. The steps below use the current pages, and so does the practice workbook. Some screenshots still show the old layout, but the clicks are the same.
For the first example, we’ll pull daily spot prices for crude oil and fuel from the U.S. Energy Information Administration (EIA):
https://www.eia.gov/dnav/pet/pet_pri_spt_s1_d.htm
You could highlight the table, copy it and paste it into Excel. If you’ve tried that, you know it’s hit or miss. Columns shift, formatting comes along for the ride, and the copy has no link to the website. When the prices change tomorrow, you start over.
Here’s the better way:
- Copy the web address of the page.
- Go to Data > From Web. It sits in the Get & Transform Data group.

- Paste the address into the URL box and click OK. If Excel asks how to connect, choose Anonymous and click Connect.

Choose the Right Table in the Navigator
The Navigator lists everything Power Query found on the page. The names won’t tell you much, so click through them and watch the preview on the right. Stop when you see the WTI and Brent prices.

Not sure you’re on the right page? Click the Web View tab to see the page the way your browser shows it.

You may need to click from one item to the next, previewing each item in the right-side preview panel, in order to determine which belongs to the desired table.

Load the Web Data to a Worksheet
If a table needs no cleanup, you can load it straight away:
- Click the arrow next to Load and choose Load To.

- Choose Table and Existing worksheet, then pick a cell such as A1.

You now have an Excel table that’s connected to a query.
The Queries & Connections pane on the right lists every query in the file.

Hover over a query to see a preview, the number of columns, the last refresh time, how it was loaded and where the data comes from.

Fix Blank Cells with Replace Values and Fill Down
The data looks fine at first glance. But product groups like Crude Oil sit on their own row with no price, and the rows below them don’t say which product they belong to.
Blank cells like these cause trouble the moment you sort, filter, chart or pivot.

So let’s fix it in the Power Query Editor.
Double-click the query in the Queries & Connections pane to open it.

- Go to Add Column > Conditional Column. Name the new column Product. If the price column equals null, output the name column. Otherwise, output null.
- Select the Product column and go to Transform > Fill > Down.

Did nothing happen? That’s what we ran into in the video.

The cells look empty, but they aren’t. Cells from a web page often hold empty text, not a real null, and Fill Down only fills null cells.
So we replace the “fake empty” cells with real nulls:
- In the Applied Steps list, select the step before your Conditional Column.

- Select the price column and go to Transform > Replace Values. Click Insert to add the step at that point.


- Leave Value To Find empty, type null in Replace With and click OK.

Now select the last step in Applied Steps. Every price has its product group next to it.

To finish:
- Click the filter arrow on the price column and uncheck (null). This removes the product group rows.
- Rename the columns and set the price column to Decimal Number.
- Rename the query SpotPrices.

- Click the top half of Close & Load on the Home tab.
Tip: do your prices turn into errors or very large numbers? Your Excel uses a comma as the decimal separator. Right-click the price header and choose Change Type > Using Locale, then pick Decimal Number and English (United States).
Refresh the Data with One Click
Now the payoff. When EIA publishes new prices, right-click the table and choose Refresh.
Or go to Data > Refresh All to update every query in the file.
Charts and pivot tables built on the table update with it.

Refresh Automatically on Open or on a Timer
Want Excel to do the refreshing for you? Go to Data > Refresh All > Connection Properties.

The most useful options:
- Refresh every N minutes
- Refresh data when opening the file
- Refresh this connection on Refresh All (untick it for slow queries you only want to update by hand)

Get a Weather Forecast with Add Table Using Examples
Picture this. You work at the front desk of a hotel in Seattle, and every morning you print the weather forecast for your guests. Copying it from a website each day gets old fast. So let’s connect Excel to the forecast once and refresh it every morning.
We’ll use the 7-day forecast from the U.S. National Weather Service:
https://forecast.weather.gov/MapClick.php?lat=47.6062&lon=-122.3321This page is a good test. The forecast isn’t stored as a classic HTML table, so it doesn’t show up as a clean table in the Navigator.
That’s where Add Table Using Examples comes in. You type two examples of what you want, and Power Query finds the rest.
It’s available in Excel for Microsoft 365.
- Go to Data > From Web, paste the address and click OK.
- In the Navigator, click Add Table Using Examples.
- In the first row, type the first period shown on the page, for example Tonight. In the next column, paste its forecast text. Do the same for the second row. Power Query fills in the rest.
- Click OK, select the new custom table and click Transform Data.
- Rename the columns to Day and Forecast.
- Rename the query SeattleWeather.
- On the Home tab, click the lower half of Close & Load, choose Close & Load To, pick Existing worksheet and click OK.
You now have a 7-day forecast in Excel. Each morning, right-click the table and choose Refresh.
Add an Emoji Column with a Conditional Column
The original weather website showed a rain cloud next to rainy days. We can do the same in Excel, with an umbrella next to any day that mentions rain or showers.
Credit for this idea goes to our friends Frédéric Le Guen and Oz du Soleil.

First, grab the umbrella emoji:
- Select an empty cell and press the Windows key and the period to open the emoji panel.

- Type rain and pick the umbrella with rain drops.

- Select the emoji in the formula bar, press Ctrl+C, then press Esc.
Now add the column:
- Double-click the SeattleWeather query to open the Power Query Editor.
- Go to Add Column > Conditional Column.

- Name the column Be Equipped. Add four rules, each with the umbrella pasted as the output: Forecast contains rain, contains Rain, contains shower, and contains Shower.

Why four rules? The contains check is case-sensitive.
The forecast says “A chance of rain” on one line and “Rain likely” on the next, so you need both spellings.
The practice workbook uses a case-insensitive version (Comparer.OrdinalIgnoreCase), so one check covers both.
- Click OK.

- Drag the Be Equipped column next to Day.

- Close & Load.

Tomorrow morning, right-click the table, choose Refresh, and print.
Download the Practice Workbook
Download the Practice Workbook
Both web queries, plus a Your Turn sheet with every step.
Frequently Asked Questions
How do I import data from a website into Excel?
Go to Data > From Web, paste the web address and click OK. In the Navigator, pick the table you want. Click Load to bring it into a worksheet, or Transform Data to clean it up in Power Query first.
How do I make web data in Excel update automatically?
Right-click the table and choose Refresh, or use Data > Refresh All. To refresh without clicking, open the query properties from Queries & Connections and tick Refresh every N minutes or Refresh data when opening the file.
Why does my website data not show up as a table in the Navigator?
The Navigator lists the tables Power Query can detect on the page. If the data is built from other page elements, it may not appear as a clean table. In Excel for Microsoft 365, click Add Table Using Examples and type two example rows so Power Query can find the pattern.
Why does Fill Down not work in Power Query?
Fill Down only fills cells that are null. Cells imported from a web page often look empty but hold empty text instead. Select the column, use Replace Values with Value To Find left empty and null in Replace With, then run Fill Down again.
Is the contains check in Power Query case-sensitive?
Yes. A Conditional Column with contains only matches the exact spelling, so rain and Rain are different. Add a rule for each spelling, or edit the formula and add Comparer.OrdinalIgnoreCase as the third argument of Text.Contains.
Which Excel versions can import data from the web?
From Web is part of Power Query, which is built into Excel 2016 and later for Windows and into Microsoft 365. Add Table Using Examples needs Excel for Microsoft 365.
Leila Gharani
Founder of XelPlus and ten-time Microsoft MVP. Leila helps over 500,000 professionals master Excel, Power BI, and data automation through practical, real-world training.








