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:
'=LET(
src, A1,
codes, {
"%C3%A4","%C3%84",
"%C3%B6","%C3%96",
"%C3%A5","%C3%85",
"%C3%BC","%C3%9C",
"%C3%A9","%C3%89",
"%C3%B1","%C3%91",
"%C3%A7","%C3%87",
"%C3%9F",
"%3F","%20","%25","%26","%3D","%7B","%7D","%5B","%5D",
"%3A","%22","%2F","%2B","%21","%23","%24","%2A","%27",
"%28","%29","%2C","%3B","%40"
},
repl, {
"ä","Ä",
"ö","Ö",
"å","Å",
"ü","Ü",
"é","É",
"ñ","Ñ",
"ç","Ç",
"ß",
"?"," ","%","&","=","{","}","[","]",
":","""","/","+","!","#","$","*","'","(",")",",",";","@"
},
REDUCE(
src,
SEQUENCE(COUNTA(codes)),
LAMBDA(s, i, SUBSTITUTE(s, INDEX(codes, i), INDEX(repl, i)))
)
)
Change “A1” to the cell address containing your 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.
%3a%5b
Missing Scandinavian letters ä, ö, å and probably in other special letters in other languages.
Done
Missing at least “%2F” to “/” and “%2B” to “+”.
Thanks Fax Ase! I’ve added and updated the formula.