How to Import XML Data from Web to Excel

You can have your XML file either on your local disk or on the web. However, as long as you are using Microsoft Excel to retrieve information from your Excel file, you are in no trouble. Excel will offer you to import XML data from any potential source. Anyways, if you are looking for ways to import an XML file from websites, this blog will help you all the way. Here, I will discuss the steps to import XML data from the web to Excel. So, without any delay, let’s begin.

About the Setup

To show you the steps to import an XML file from the web, I’m going to use the sitemap link of Microsoft’s official website. If you follow the link below, you will end up getting an XML file online. Now let me show you import this XML file to Microsoft Excel.

https://www.microsoft.com/en-us/learning/sitemap.xml

Guide to Import an XML File from Web to Excel

Microsoft Excel has a powerful feature called Power Query to import data from multiple sources. To import an XML file from Web to Excel, follow these steps:

  1. Go to the Data tab in the ribbon.
  2. Then, click on the From Web command in the Get & Transform Data group.
    This will allow you to insert a website link to retrieve information from an online XML file.
    Navigating to Data tab to choose From Web option Alternatively, to get From Web option by following Data > Get Data > From Other Sources > From Web.Import XML Data from Web to Excel
  3. Select the From Web command and From Web dialog box appears.
  4. Now, insert a weblink that refers to an XML file just below the URL section.
  5. After that, hit OK.
    Guide to Import an XML File from Web to Excel
    Now, the Navigator window appears. Here, in the left column of the Navigator window, you will see your weblink with a folder sign. If you expand the folder, you will see “url” just beside a tabular icon.
  6. Select ‘url’ to expand its content on the right side of the Navigator window.
  7. Finally, click on the Transform Data command to proceed.
    Guide to Import an XML File from Web to Excel
    Now, Excel will take you to the Power Query Editor window. Here, you will see the XML file has been extracted in columns and rows. You can edit the XML data here if you like.
  8. Then, hit the Close & Load button to load the XML data in an Excel worksheet.

Guide to Import an XML File from Web to Excel

Now, you have successfully imported XML data from the web to an Excel worksheet. However, the connection is semi-dynamic. So, if there any changes occur in the XML data online, the Excel worksheet will be updated automatically if you refresh your worksheet.

Imported XML data from the web to an Excel worksheet

In Queries & Connections task pane, under the Queries tab, you will see how many rows have been loaded from the XML file to Excel.

Queries & Connections pane after loading the rows

 

Conclusion

So, I’ve demonstrated the steps to import an XML file from the web to an Excel worksheet. I hope you will find this article helpful. If you have any further queries regarding XML file importing and exporting, feel free to drop them in the comment section below. I will try to respond as soon as possible. Thanks for the read.

Frequently Asked Questions

How do I convert XML to XLSX?

To convert XML to XLSX in Excel:

  1. Open Excel and go to the Data tab.
  2. Click Get Data, select From File, and choose From XML.
  3. Locate and open your XML file.
  4. Excel will display the XML data; use the Power Query Editor to refine if needed.
  5. Click Close & Load to import the XML data into Excel.
  6. Once loaded, go to File, choose Save As, and select Excel Workbook (*.xlsx) as the format.
  7. Save the file to convert XML to XLSX format.

How to extract data from XML file?

To extract data from an XML file:

  1. Open Excel and go to the Data tab.
  2. Select Get Data, then From File, and choose From XML.
  3. Locate and open your XML file.
  4. Excel will display the XML data in a structured table.
  5. Use the Power Query Editor to filter, transform, and extract specific data.

Click Close & Load to import the extracted data into Excel. Alternatively, use XPath queries for more precise extraction.

How do I edit an XML file in Excel?

To edit an XML file in Excel, follow these steps:

  1. Open Excel and go to the Data tab.
  2. Click Get Data, select From File, and choose From XML.
  3. Locate and open your XML file.
  4. Excel will display the XML data in a structured table.
  5. Make edits directly in the cells or use the Power Query Editor for advanced transformations.

Once edited, click Close & Load to save changes back to the XML file.

Related Articles

Rate this post

Leave a Reply

Your email address will not be published. Required fields are marked *