ENCODEURL function. Converts to URL-encoded string.(Microsoft Excel)

03/26/2024

Japanese version.

Characters that cannot be used in URLs (such as ? and &) to text that can be used in URLs (URL encoding or percent encoding).

This function is a feature added since Excel 2013,

It is often used to create URL parameters for access analysis tools such as Google Analytics.

Since half-width spaces and many symbols need to be converted, it is safe to use the ENCODEURL function for all values to be used as URL parameters.

The ENCODEURL function is also required when specifying URL parameters in the HYPERLINK and WEBSERVICE functions.

How it works

=ENCODEURL(text)
ArgumentOmissionExplanation
textRequired argument.Specify the string or cell to be converted.

Demonstrate

As an example, it is used for UTM parameters in Google Analytics.(Red text is variable)

="?utm_medium="&ENCODEURL(text)&"&utm_campaign="&ENCODEURL(text)&"&utm_source="&ENCODEURL(text)

Notes.

Converting an entire URL will break the URL.

For example, converting "https://www.samurai-emblem.com/" would result in "https%3A%2F%2Fwww.samurai-emblem.com%2F", which is an invalid text for a URL.

In that case, use a conversion tool.

Spill

If you specify the argument "text" the cell range, it will be Spil.

---

Links

Microsoft Excel Functions Web