The FILTERXML function in Excel is a powerful tool designed to parse XML data and retrieve specific information using XPath queries. It enables users to manipulate and analyze data fetched from web services, enabling enhanced data analysis directly within Excel spreadsheets.
- element from the XML string, resulting in:
– Value1
– Value2
element from the XML response, producing:
– Data Retrieved
elements from the XML, yielding:
– Alice
– Bob
Syntax
FILTERXML(xml, xpath)
- xml: A string that contains the XML data to be parsed.
- xpath: A string that specifies the XPath expression used to extract the data.
Example #1
=FILTERXML("- Value1
- Value2
", "//item")
This function retrieves the values of each Example #2
=FILTERXML("Success Data Retrieved ", "//message")
This function extracts the Example #3
=FILTERXML("Alice Bob ", "//name")
This formula pulls all Error handling
- VALUE!: This error occurs if the xml parameter is not a valid XML string.
- NUM!: This error can appear if the XPath expression cannot be evaluated due to syntax issues.
- REF!: Raised when the referenced xml data cannot be found or is inaccessible.