Skip to content
ExcelExcel 2013+

FILTERXML function in Excel

Returns specific data from the XML content by using the specified XPathThis function is not available in Excel for the web.

=FILTERXML(xml, xpath)

FILTERXML syntax and parameters

Two arguments, two required.

  • xmlstringRequired

    A string in valid XML format

  • xpathstringRequired

    A string in standard XPath format

FILTERXML examples

Formulas you'll actually reuse.

  1. One value out of an XML feed by XPath:

    =FILTERXML(WEBSERVICE("https://example.com/rates.xml"), "//rate[@currency='EUR']")
  2. The old split-text trick — wrap a comma list in XML, then pull every <s> node:

    =FILTERXML("<t><s>" & SUBSTITUTE(A2, ",", "</s><s>") & "</s></t>", "//s")

FILTERXML in Google Sheets

No direct equivalent — here's the way around.

Try FILTERXML in the playground

Edit the example — nothing to install.

Preloaded with the FILTERXML formula from Example 1 — change anything and watch it respond.

Loading the editor…

FILTERXML errors

What they mean — and the fixes.

  • #VALUE!

    The XML isn't well-formed or the XPath matches nothing — check for unescaped & characters in the source.