Remove or Replace Everything After Character Google Sheets

I was creating affiliate links but the urls that I was working with had tracking code added to the end with javascript. There were 40 links that looked like this:

http://www.headlineshirts.net/sharkula-t-shirt.html#.VmQs-Yl96Uk

I didn’t want to delete the code manually even though it wouldn’t take that much time. I wanted to remove the # and everything after it.

I was able to use this function in Google Sheets.

#.*

Select the calls you want to edit and use the Find and Replace feature and don’t forget to check “Search using regular expressions.”

Remove everything after character

You can see that I left the Replace with area empty. That is because I just wanted to remove text. But you could change the text this way if you wanted.

2 Comments

  1. Holy smokes this is awesome. Exactly what I was looking for. thank you so much!

Leave a Reply

Your email address will not be published. Required fields are marked *