FILTERXML function

This article describes the formula syntax and usage of the FILTERXML function in Microsoft Excel.

Note: The FILTERXML function is not available in Excel Online, and it is not available in Excel 2016 for Mac.


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.


Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Query URL:

XML Response:


Most recently changed:








This example uses the FILTERXML function on XML data returned in cell B3, which is provided by the results of the WEBSERVICE function on the web query in cell A2. The data from FILTERXML is returned in cells B7:B9 and C7:C9, and shows the three most recently updated query results on Wikipedia and the time of their updates (in UTC, "Coordinated Universal Time").

Cells B7:B9 contain the formula =FILTERXML(B3,"//rc/@title"), which needs to be entered as an array formula in those cells. Select B7:C9, enter the formula, and press Ctrl+Shift+Enter. Cells C7:C9 contain the formula =FILTERXML(B3,"//rc/@timestamp"), and also needs to be entered as an array formula.

Expand your skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.