URL Decode formula for Excel

2018-04-17T11:28:11-07:00April 5th, 2018|Microsoft Excel|Comments Off on URL Decode formula for Excel

Excel provides a EncodeURL() function to encode URLs, but surprisingly does not provide any function to decode a URL (e.g., DecodeURL or UnencodeURL).  Instead, you can use the following formula:

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(CELL_CONTAINING_ENCODEDURL,"%3F","?"),"%20"," "),"%25", "%"),"%26","&"),"%3D","="),"%7B","{"),"%7D","}"),"%5B","["),"%5D","]"),"%3A",":"),"%22","""")

Replace CELL_CONTAINING_ENCODEDURL with cell address containing the encoded URL.

Please let me know if I’ve missed any codes and I’ll update the formula.

Thanks to Christi Olson for providing basis of the formula.  I completed it with some missing pieces.