2

Working in Google Sheets, I have a column with a list of URLs. I'm trying to add a column that automatically populates the blog link (all sites end in "/blog").

However, my list of URLs are formatted differently, some ending with / and some without.

I understand how to add "blog" to the URL structure automatically (=C2&"/blog"), but how can I tell the cells to look at whether a "/" is already at the end or not, in order to populate "/blog" or "blog" accordingly?

3

Use RIGHT(C2,1) to get the last character
The use IF to add "/" in case that it's required

Example

=C2&IF(RIGHT(C2,1)<>"/","/","")&"blog"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.