How to Remove a Trailing Slash from a URL Link in Excel

If you want to remove the trailing slash from URL link in Excel, there are formulas that can be used individual or combination of the following functions LEFT, RIGHT and LEN to delete a slash from a path or URL. The procedure for doing this is demonstrated in this article below.

Remove a trailing slash from a URL link in Excel

To remove a trailing slash from a path or a URL in Excel using the LEFT and LEN functions, follow the procedure below:

Example 1

  • Click on Formulas on the menu bar in Excel.
  • Next, click on Text.
  • Scroll down the list that displays and click on LEFT.

The dialogue box will display as shown in the example below:

Figure 1. Accessing the LEFT function to remove slash from URL

Example 2

  • In the text field, enter the following: B5,LEN(B5)-(RIGHT(B5)=”/”)
  • B5 is the address of the cell containing the URL from which you wish to remove a trailing slash. In the example below, it is http://pinkash.com/about-me/
  • After that, click on OK.

It will show you the result displayed in the screenshot below:

Figure 2. Results of remove slash from URL using LEFT and LEN functions

Interpretation of the Result

In the example displayed in Figure 2 above, the list on the left comprises of URLs containing trailing slashes, that is, they each end in a “/.” The list on the right comprises of URLs from which the trailing slashes have been removed using the LEFT and LEN functions in Excel as described above. This has been achieved by using the formula

=LEFT(B5,LEN(B5)-(RIGHT(B5)="/")).

B5 is the address of the cell containing the URL from which a trailing slash is intended to be removed. You can easily look at the table and verify that the URL has been removed by physically each URL on the left and its corresponding URL on the right.

Another way to remove a trailing slash from a URL is to simply type the formula above into the cell on the right of the corresponding URL from which you wish to remove a trailing slash. Hit the enter key when you finish typing, and the result will show.

Irrespective of whether you use the first or second method, you will have to apply it to each individual URL on the left column. That is, for every URL address on the left, you will put the cursor on its corresponding cell on the right and type in the formula indicating the appropriate cell address.

The way the formula functions

What this formula does essentially is to use the LEFT function to enter the URLs beginning from the left. The expression below is used by the formula to dictate the characters that should be entered: LEN(B5)-(RIGHT(B5)=”/”)

The total number of characters represented by the expression above, the characters represented by the expression below are subtracted: RIGHT(B5)=“/”

If the last character in the URL address is a slash, one character is subtracted from the right. However, if the last character is not a slash, nothing is subtracted from the right. The final output is displayed in the column on the right without the slash being retained.

Still need some help with Excel formatting or have other questions about Excel? Connect with a live Excel expert here for some 1 on 1 help. Your first session is always free. 

Our customers love us!
“The expert was absolutely amazing and stuck with me the whole way through. They were polite, patient, seemed to want to genuinely help me and provided a solution that I would never have managed otherwise. I could not be more thankful for their support and solution. Thank you!” - - Chris T, in California

Leave a Comment

avatar