The FILTERXML function returns specific data from the XML content by using the specified XPath.

  • This function was introduced in Excel 2013 and so is not available in earlier versions.

Syntax

=FILTERXML(xml,xpath)

Arguments

Argument Description
xml A string in valid XML format
xpath A string in standard XPath format

Examples

  A B C
1 Query URL    
2 http://en.wikipedia.org/w/api.php?action=query&list=recentchanges&rcnamespace=0&format=xml
3      
4 XML Response:    
5 =WEBSERVICE(A2)    
6      
7 Most recently changed:    
8 =FILTERXML(A5,”//rc/@title”) =FILTERXML(A5,”//rc/@timestamp”)  
9 =FILTERXML(A5,”//rc/@title”) =FILTERXML(A5,”//rc/@timestamp”)  
10 =FILTERXML(A5,”//rc/@title”) =FILTERXML(A5,”//rc/@timestamp”)  

Common Function Error(s)

Problem What went wrong
#VALUE! Occurs if either:

  the xml argument is not valid
  the xml argument contains a namespace with a prefix that is not valid