How to Convert Excel to XML File (With Easy Steps)

Similar to HTML, XML is also a markup language. But unlike HTML, it is designed to store and transport data. Excel users often need to store their data in XML format. This allows them to store their data on the web and make it accessible to other users. In this article, we will discuss how to convert an Excel dataset to XML file.


Download the Practice Workbook


Convert Excel to XML File: 6 Easy Steps

In this discussion, we will learn how to convert an Excel dataset to XML in detail. We will start by creating an Excel dataset and finally export the dataset as XML. We will use the sample dataset below to illustrate the process.

Sample Data


Step 1: Creating Dataset in Excel

  • To begin with, we will create a dataset in an Excel spreadsheet.
  • Then, we will convert this sheet to an XML file.

Step-by-Step Procedures to Convert Excel to XML File


Step 2: Saving XML Schema in Notepad

  • Secondly, we will write our XML schema in a text editor.
  • In this case, we will write it in Notepad.

Step-by-Step Procedures to Convert Excel to XML File

  • Then, go to the File tab of Notepad.
  • Select the Save As option.

Step-by-Step Procedures to Convert Excel to XML File

  • Once that is done, write the file name with an .xml extension.
  • Then, select Save.

Step-by-Step Procedures to Convert Excel to XML File


Step 3: Opening XML Source Panel

  • Thirdly, in the Excel worksheet, we need to open the XML Source panel.
  • To do that, first go to the Developer tab.
  • After that, select the Source command from the XML option.

Step-by-Step Procedures to Convert Excel to XML File

  • As a result, the right side of the Excel worksheet will now display the XML Source panel.

Step-by-Step Procedures to Convert Excel to XML File


Step 4: Adding XML Map Using Developer Tab

  • Then, from the XML Source panel, click on the XML Maps tab.

Step-by-Step Procedures to Convert Excel to XML File

  • Consequently, the XML Maps dialogue box will appear on the screen.
  • From the dialogue box select Add.

Step-by-Step Procedures to Convert Excel to XML File

  • Afterward, we will add the XML file that we have created previously.
  • Finally, click OK.

Step-by-Step Procedures to Convert Excel to XML File

  • Consequently, we will find that the elements of our dataset will appear in the XML Source panel.

Step-by-Step Procedures to Convert Excel to XML File


Step 5: Incorporating XML Elements to Dataset

  • Finally, we will incorporate the XML elements into our dataset.
  • To do that, first select the first row header in your dataset.
  • In this case, that is “Name”.
  • Then, select the element having the same name from the XML Source panel.

Step-by-Step Procedures to Convert Excel to XML File

  • As a result, you will see that the selected row header and the dataset under it have turned into a table.

Step-by-Step Procedures to Convert Excel to XML File

  • Then, do the same for the rest of the row headers.
  • In our case, we have another row header named “Sales”.

Step-by-Step Procedures to Convert Excel to XML File

  • Finally, you will find that all the entries from your dataset will be turned into a table.

Sample Data


Step 6: Exporting XML Data

  • Finally, we will export the Excel dataset as an XML file.
  • To do that, first go to the Developer tab.
  • Then, from there select the Export option.

Sample Data

  • You will notice that the file already has an .xml extension.
  • Finally, click on Export.

Sample Data

  • Then, open the XML file.
  • You will see that the existing data set will be turned into XML.

Sample Data


Things to Remember

  • Before converting Excel to XML, ensure that you have a clear understanding of the XML structure.
  • Give special attention to the data types of the mapped XML elements. Excel interprets certain data types differently, such as dates, numbers, or text.
  • Finally, perform testing of XML conversion with various test cases to ensure accuracy.

Frequently Asked Questions

1. Can I customize the XML structure during the conversion process?

Yes, you can customize depending on the method you use. You may have the options to define XML tags, hierarchy or other formatting aspects.

2. Can formulas and formatting be preserved in the converted XML file?

Excel to XML conversion focuses mainly on data. So, formulas and formatting are not usually preserved in XML output.

3. How to Convert XML into Excel File.

There are 2 easy ways to convert an XML file into Excel. One is to use Power Query feature. You’ll get a dedicated From XML option from the drop-down options of From File option in the Data tab. Apart from it, you can also use the Import option from the Developer tab.


Convert Excel to XML: Knowledge Hub


Conclusion

XML allows Excel users to store data on the web, thus exposing the data to the customers on the web to access. After going through this article, the readers will have a clear understanding of how to convert Excel to XML. Please feel free to leave a comment if you have any queries or recommendations for improving the article’s quality. To learn more about Excel, you can visit our website. Happy learning!

<< Go Back to Export Excel to XML | Export Data from Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Adnan Masruf
Adnan Masruf

Adnan Masruf, holding a BSc in Naval Architecture & Engineering from Bangladesh University of Engineering and Technology, plays a pivotal role as an Excel & VBA Content Developer at ExcelDemy. His deep passion for research and innovation seamlessly aligns with his dedication to Excel. In this capacity, Masruf not only skillfully addresses challenging issues but also exhibits enthusiasm and expertise in gracefully navigating intricate situations, underscoring his steadfast commitment to consistently delivering exceptional content. His interests... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo