Encode URL parameters in MS Excel 2013 and above

Function ENCODEURL() is good for encoding URL component but requires extra work to encode a string to be used in a query part of a URL.

More specifically ENCODEURL() encodes spaces as %20 instead of + character. This can be solved by substituting %20 with + in a string produced by ENCODEURL().

Example #1: A + B

=CONCATENATE("https://www.google.com/search?q=",SUBSTITUTE(ENCODEURL("A + B"),"%20","+"))



Example #2: Unicode support

=CONCATENATE("https://www.google.com/search?q=",SUBSTITUTE(ENCODEURL("Привет мир!"),"%20","+"))



Leave a Reply

You may use simple HTML to add links or lists to your comment. Also use <pre><code class="language-*">...</code></pre> to mark up code snippets. We support language-js, language-markup and language-css for comments.