Sunteți pe pagina 1din 3

 |

By using this site you agree to the use of cookies for analytics, personalized content and ads.
Learn More

Office Products All Microsoft


Apps 
Resources Cart 
Search 
Install
More Sign in
Account
Buy Office 365
Training

Admin

FILTERXML function
Excel for Office 365, Excel 2019, Excel 2016, Excel 2013

This article describes the formula syntax and usage of the FILTERXML function in Microsoft Excel.

Notes: 

The FILTERXML function is not available in Excel Online and Excel for Mac.

This function may appear in the function gallery in Excel for Mac, but it relies on features of the
Windows operating system, so it will not return results on Mac.

Description
Returns specific data from the XML content by using the specified XPath.

Syntax
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.


Remarks
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.

Example
This example uses the FILTERXML function on XML data returned in cell B2, which is provided by the
results of the WEBSERVICE function on the web query in cell B1.

The data from FILTERXML is returned in cells B3:B5 and C3:C5, and shows the three most recently
updated query results on Wikipedia and the time of their updates (in UTC, "Coordinated Universal
Time").

Cells B3:B5 contain the formula =FILTERXML(B3,"//rc/@title"), which needs to be entered as an array
formula in those cells. Select B3:C5, enter the formula, and press Ctrl+Shift+Enter. Cells C3:C5 contain
the formula =FILTERXML(B3,"//rc/@timestamp"), and also needs to be entered as an array formula.

Note: If you have a current version of Office 365, then you can simply enter the formula in the top-
left-cell of the output range, then press ENTER to confirm the formula as a dynamic array formula.
Otherwise, the formula must be entered as a legacy array formula by first selecting the output range,
entering the formula in the top-left-cell of the output range, and then pressing CTRL+SHIFT+ENTER
to confirm it. Excel inserts curly brackets at the beginning and end of the formula for you. For more
information on array formulas, see Guidelines and examples of array formulas.

Need more help?


You can always ask an expert in the Excel Tech Community, get support in the Answers community,
or suggest a new feature or improvement on Excel User Voice.
Expand your Office skills Get new features first
EXPLORE TRAINING  JOIN OFFICE INSIDERS 

Was this information helpful? Yes No

What's new Store & Education Enterprise Developer Company


Support
NEW Surface Pro 6 Microsoft in Microsoft Azure Microsoft Visual Careers
Account profile education Studio
NEW Surface Laptop Microsoft Industry Privacy at
2 Download Center Office for students Developer Network Microsoft
Data platform
NEW Surface Go Sales & support Office 365 for TechNet EU Compliance
schools Microsoft partner DoCs
Xbox One X Returns resources Channel 9
Deals for students Investors
Xbox One S Order tracking & parents Health Office Dev Center
Security
Windows 10 apps Recycling Financial services

Office apps Commercial


Warranties

 English (Ireland)

Contact Us Privacy & Cookies Terms of use & sale Trademarks Office accessibility Legal © Microsoft 2019

S-ar putea să vă placă și