The Excel ENCODEURL function percent-encodes text so it is safe to use inside a URL — spaces become %20, ampersands %26, and so on. It is the glue that makes WEBSERVICE calls and HYPERLINK query strings reliable.
Syntax
| Argument | Description | |
|---|---|---|
text | Required | The string to percent-encode. |
How to use it
Building a query URL from cell values — encode each piece, not the whole URL:
Encoding the entire URL would also encode the :// and ? separators and break it. Encode only the values.
Windows desktop only: the Web functions (ENCODEURL, FILTERXML, WEBSERVICE) are not available in Excel for the Web, Excel for Mac, or mobile — cells show #NAME? there. For cross-platform data pulls, use Power Query (Data → From Web) instead.
Try it: interactive demo
Type any text and see exactly what ENCODEURL would return.
Errors & common pitfalls
Pitfall: encoding the whole URL. ENCODEURL is for query values. Run it on https://example.com?q=x and the slashes and question mark get encoded too, breaking the link.
Windows desktop only: the Web functions (ENCODEURL, FILTERXML, WEBSERVICE) are not available in Excel for the Web, Excel for Mac, or mobile — cells show #NAME? there. For cross-platform data pulls, use Power Query (Data → From Web) instead.
Power Query is usually the better tool. These functions predate Power Query; for refreshable, authenticated, multi-row web data, Data → Get Data → From Web wins on every axis. The Web functions remain handy for quick one-cell lookups.
Practice workbook
Frequently asked questions
What characters does ENCODEURL change?
Why does ENCODEURL show #NAME? on my Mac?
Is there a decode function?
When do I actually need it?
Master functions like this in one day
This page covers one function. Our Excel Formulas and Functions class covers the 30 that matter most — live, hands-on, taught by professionals in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.
See the Formulas & Functions Class