I don't see any functions to solve this. So I made little VBA-code to handle it.
Long URLs in Column A begins with row 1. Fixed URLs will be placed in Column B. Here is the code for that. Hope it's helping you.
Sub Shorten_URL()
Dim slash_count As Integer 'counts how many slashes has been found starting from beginning of the URL
Dim URL_rows As Integer 'Current row counter
Dim URL_chr As Integer 'Counts characters in URL
slash_count = 0
URL_rows = 1
Do Until Range("A" & Trim(Str(URL_rows))) = ""
For URL_chr = 1 To Len(Range("A" & Trim(Str(URL_rows))))
If Mid(Range("A" & Trim(Str(URL_rows))), URL_chr, 1) = "/" Then
slash_count = slash_count + 1
End If
If slash_count = 4 Then
Range("B" & Trim(URL_rows)) = Left(Range("A" & Trim(URL_rows)), URL_chr - 1)
slash_count = 0
Exit For
End If
Next
URL_rows = URL_rows + 1
Loop
End Sub
Bookmarks