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.


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.

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.

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

Was this information helpful?

Yes No

How can we improve it?

255 characters remaining

To protect your privacy, please do not include contact information in your feedback. Review our privacy policy.

Thank you for your feedback!

Support resources

Change language