Excel: Remove everything after ? in a url




  • Cater for the ? not appearing in A1 without raising an error
  • Properly truncating the string to http://www.site.com/index.php .... your accepted answer doesnt adjust for the position of ? and it will return http://www.site.com/index.php?

You may try something like this:


Here A1 is your url

If you want to return another hyperlink, but only cosisting of everything before the question mark, you could use the following formula, having you URL in cell A1.