FILTERXML function

This article describes the formula syntax and usage of the FILTERXML function (function: A prewritten formula that takes a value or values, performs an operation, and returns a value or values. Use functions to simplify and shorten formulas on a worksheet, especially those that perform lengthy or complex calculations.) in Microsoft Excel.

 Note    The FILTERXML function is not available in Excel Online.


Returns specific data from the XML content by using the specified XPath.


FILTERXML(xml, xpath)

The FILTERXML function syntax has the following arguments.

  • Xml    Required. A string in valid XML format.
  • Xpath    Required. A string in standard XPath format.


  • If xml is not valid, FILTERXML returns the #VALUE! error value.
  • If xml contains a namespace with a prefix that is not valid, FILTERXML returns the #VALUE! error value.


The workbook below shows examples of this function. Inspect them, change existing formulas, or enter your own formulas to learn how the function works.

To work more in-depth with the example data in Excel, download the embedded workbook to your computer, and then open it in Excel.

Applies to:
Excel 2013, Excel Online