ExcelExcel 2013+
FILTERXML function in Excel
Returns specific data from the XML content by using the specified XPathThis function is not available in Excel for the web.
=FILTERXML(xml, xpath)FILTERXML syntax and parameters
Two arguments, two required.
- xmlstringRequired
A string in valid XML format
- xpathstringRequired
A string in standard XPath format
FILTERXML examples
Formulas you'll actually reuse.
One value out of an XML feed by XPath:
=FILTERXML(WEBSERVICE("https://example.com/rates.xml"), "//rate[@currency='EUR']")The old split-text trick — wrap a comma list in XML, then pull every <s> node:
=FILTERXML("<t><s>" & SUBSTITUTE(A2, ",", "</s><s>") & "</s></t>", "//s")
FILTERXML in Google Sheets
No direct equivalent — here's the way around.
Try FILTERXML in the playground
Edit the example — nothing to install.
Preloaded with the FILTERXML formula from Example 1 — change anything and watch it respond.
Loading the editor…
FILTERXML errors
What they mean — and the fixes.
#VALUE!The XML isn't well-formed or the XPath matches nothing — check for unescaped & characters in the source.
Related functions
More ways Excel gets this done.
- ENCODEURLReturns a URL-encoded stringThis function is not available in Excel for the web.WebGoogle Sheets
- WEBSERVICEReturns data from a web service.This function is not available in Excel for the web.WebNo Google Sheets equivalent
- ABSReturns the absolute value of a numberMathGoogle Sheets
- ACCRINTReturns the accrued interest for a security that pays periodic interestFinancialGoogle Sheets
- ACCRINTMReturns the accrued interest for a security that pays interest at maturityFinancialGoogle Sheets
- ACOSReturns the arccosine of a numberMathGoogle Sheets