What Most People Miss About Converting XML to Excel

Yes, Excel can open XML files directly. But if you double-click an XML file and expect a tidy spreadsheet, you’ll get raw tags, blank rows, and missing relationships — not a usable table.

The Problem

You’ve just received sales_report_2024_q1.xml from your ERP system. It contains 87 orders, customer names, product SKUs, dates, and amounts. You need to analyze it in Excel — filter by region, sum revenue by month, compare against last quarter. So you drag it into Excel… and see this:

A1B1C1D1
<?xml version="1.0" encoding="UTF-8"?>   
<orders>   
  <order id="ORD-7821">   
    <customer>Sarah Chen</customer>   
    <product_sku>XTR-904</product_sku>   
    <date>2024-03-15</date>   
    <amount>45200.00</amount>   
  </order>   
  <order id="ORD-7822">   
    <customer>Javier Mendoza</customer>   
    <product_sku>ZEN-117</product_sku>   

That’s not a dataset — it’s a document. No headers. No consistent columns. No way to sort or pivot. And worse: Excel didn’t auto-detect the structure because the XML lacks a schema (.xsd) or inline DTD. You’re stuck copying-pasting, using Notepad++, or begging IT for a CSV export.

The Solution

Excel has built-in XML import — but it’s buried under Data > Get Data > From File, and only works reliably when you don’t use the legacy ‘Import XML’ button (which is deprecated and often fails on nested data). Here’s what actually works — tested on Excel 365, 2021, and LTSC:

  1. Open Excel → go to the Data tab. Don’t click “From XML” in the legacy Import group (it’s grayed out in newer versions anyway).
  2. Click “Get Data” → “From File” → “From XML”. Navigate to your file and select it. Click Import.
  3. In the Navigator window, expand the root node (e.g., orders). You’ll see child nodes like order, customer, product_sku. Select order — that’s your repeating record.
  4. Click “Transform Data” (not “Load”). This opens Power Query Editor — where the real magic happens.
  5. In Power Query, right-click the column with XML attributes (e.g., Attribute:id) and choose “Remove Columns”. Then select all attribute columns (Attribute:*) and remove them.
  6. Click “Expand” (the double-arrow icon) next to the main record column (e.g., order). Check every field you need: customer, product_sku, date, amount. Uncheck “Use original column name as prefix”.
  7. Right-click each column → “Change Type”: set date to Date, amount to Decimal Number, product_sku to Text.
  8. Click “Close & Load”. Your data lands cleanly in Sheet1 starting at A1 — no manual cleanup needed.

Here’s what you get after those 8 steps:

A1B1C1D1E1
customerproduct_skudateamountid
Sarah ChenXTR-9042024-03-15$45,200.00ORD-7821
Javier MendozaZEN-1172024-03-16$12,850.00ORD-7822
Priya KapoorXTR-9042024-03-17$45,200.00ORD-7823
Liam O’SullivanTUR-2022024-03-18$8,990.00ORD-7824
Anya PetrovaZEN-1172024-03-19$12,850.00ORD-7825
Diego SilvaXTR-9042024-03-20$45,200.00ORD-7826
Maya RahmanTUR-2022024-03-21$8,990.00ORD-7827

You now have a proper table — ready for filters, PivotTables, and formulas like =SUMIFS(E2:E100,"XTR-904",B2:B100). And yes — this answers how do i convert xml to excel without add-ins or coding.

Going Further

Once you’ve got the basics down, three things will save you hours:

  • Reimporting updated XML: If your source file changes (e.g., nightly exports), just right-click any cell in your loaded table → “Refresh”. Power Query reruns the full transformation — even if the new XML adds fields like <region>EMEA</region>. Just go back to Power Query Editor, expand the new column, and change its type.
  • Handling hierarchical XML: Some files nest deeply — e.g., <order><customer><address><city>Berlin</city></address></customer></order>. Don’t panic. In Power Query, click the nested table icon (⧉) next to customer, then expand address, then expand city. It’s iterative — but predictable.
  • Converting XML with attributes + elements: If your XML looks like <item sku="XTR-904" price="45200.00">Premium Widget</item>, Power Query splits those into two columns automatically: Attribute:sku and Value. Rename Value to description, then promote the first row to headers if needed.
  • Shortcut tip (the surprising one): Press Alt+D+T to open the legacy XML Import Wizard — but only if your XML has an inline DTD or references an external XSD. It fails silently on most modern REST API exports. So unless you’re working with legacy EDI/XML from SAP R/3 circa 2005, skip it. Seriously — I wasted two mornings on this once.

When NOT to Use This

This method breaks down in four specific cases — and knowing when to walk away saves time:

  • Files over 50 MB: Excel’s XML parser chokes. You’ll get “Not enough memory” or freeze for 8+ minutes. For large files, use Python (pandas + lxml) or PowerShell — then paste the result into Excel.
  • XML with mixed content: E.g., <note>Shipped today — tracking #UPS123</note>. Excel can’t separate formatting from text. The whole block lands in one cell as plain text. Clean it in Notepad++ first with regex <[^>]+> → replace with nothing.
  • No repeating root: If your XML is flat — like <config><timeout>30</timeout><debug>false</debug></config> — there’s no “table” to build. Use Data → Get Data → From Other Sources → Blank Query, then enter =Xml.Tables(File.Contents("C:\data\config.xml")) manually.
  • Namespaces everywhere: If your XML starts with <root xmlns="http://example.com/ns">, Power Query ignores all elements unless you strip the namespace first. Add a step in Power Query: = Table.TransformColumns(#"Previous Step",{{"Column1", each Xml.Document(Text.Replace(_, "xmlns=\"http://example.com/ns\"", "")), type text}}).

Keyboard Shortcuts

These five shortcuts cut your XML import time by ~60% — especially when you’re doing batch imports:

ShortcutActionWhen to Use
Alt+D+POpen Power Query Editor directlyAfter loading XML — skip the ribbon clicks
Ctrl+Shift+F10Toggle column selection mode (for multi-column ops)When expanding 5+ nested fields at once
Alt+H+O+IAuto-fit column widthAfter expanding — avoids horizontal scrolling
Alt+F5Refresh all queriesWhen reimporting daily XML dumps
Ctrl+Shift+UToggle formula bar (shows full XML path)When debugging why a column won’t expand
James Chen

James Chen

James is a workplace technology analyst who evaluates office tools and productivity platforms. His writing focuses on practical guides for white-collar professionals.