Excel Function: ENCODEURL

Purpose

The ENCODEURL function replaces all non-ASCII & URL reserved characters in a text value with URL escape codes.

The output of ENCODEURL is text which can be included in a URL.

Invocations of the ENCODEURL function take the form:

ENCODEURL(text)

Limitations

Arguments

ArgumentArgument typeDescription
textMandatoryThe text to be encoded.

Related Functions

Function(s)ExamplePurpose
FILTERXML, WEBSERVICEFILTERXML(WEBSERVICE(ENCODEURL(url)),xpath)Sanitise a URL, use it to call a web service, then extract data from the response.
HYPERLINKHYPERLINK(ENCODEURL(url),[friendly_name])Sanitise a URL, then create a clickable link to the resource located at it.
WEBSERVICEWEBSERVICE(ENCODEURL(url))Sanitise a URL, then use it to call a web service.

Examples

ExampleDescriptionFormulaResult
1Encode an entire URL.=ENCODEURL("https://www.abcd.com")https%3A%2F%2Fwww.abcd.com
2Encode the parts necessary to generate a valid URL.=ENCODEURL("https")&"://"&ENCODEURL("abcd.com")https://www.abcd.com
3Encode a text value which is not a URL.
  • ENCODEURL can be applied to any text value.
  • ENCODEURL replaces the space character with “%20”.
=ENCODEURL("Lorem ipsum dolor sit")Lorem%20ipsum%20dolor%20sit
4Encode a numeric value.
  • ENCODEURL can be applied to numbers.
  • When ENCODEURL is applied to a number the input and the result are equal.
=ENCODEURL(123.456)123.456
5Encode non-ASCII characters.=ENCODEURL("€ ü")%E2%82%AC%20%C3%BC