FILTERXML(xml, xpath)

Returns the specific data from the xml content by using xpath.

xmlA string in xml format.
xpathA string in xpath format.

Remarks

* Added in Excel 2013.
* This function is often used in conjunction with the WEBSERVICE function.
* The "xml" must be less than 255 characters.
* If "xml" is not valid, then #VALUE is returned.
* If "xml" contains a namespace that is not valid, then #VALUE is returned.
* For the Microsoft documentation refer to support.office.com

 A
1=FILTERXML(WEBSERVICE("http://www.bettersolutions.com/excel/xml/example.xml"),"//city/name") = #VALUE!
2=FILTERXML("<menu><food><name>Pizza</name></food></menu>","//food/name") = Pizza
3=FILTERXML("<menu><food><name>Pizza</name></food></menu>","//food[2]/name") = Pizza
4=FILTERXML("<menu><food><name>Pizza</name></food></menu>","//food["&ROW()&"/name") = Pizza

1 - Take the first tag "city" and return the contents from the name node.
2 - Returns the name from the second node.

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top