Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • How to Create One and Two Variable Data Tables in Excel
  • How to add Trendline to a chart in Excel
  • How To Create Pareto Chart in Excel
  • How to Create Column Chart in Excel
  • Use Data Form to input, edit and delete records in Excel

References

  • Lookup entire row in Excel
  • MATCH function: Description, Usage, Syntax, Examples and Explanation
  • LOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • How to get relative column numbers in a range in Excel
  • Two-column Lookup in Excel

Data Validations

  • Excel Data validation no punctuation
  • Excel Data validation require unique number
  • Excel Data validation number multiple 100
  • Excel Data validation must begin with
  • Excel Data validation don’t exceed total

How to strip protocol and trailing slash from URL in Excel

by

To remove the protocol (i.e. http://, ftp://, etc.) and trailing slash from a URL, you can use a formula based on the MID, FIND, and LEN functions.

Formula

=MID(url,FIND("//",url)+2,LEN(url)-FIND("//",url)-1-(RIGHT(url)="/"))

Explanation

In the example shown, the formula in C5 is:

=MID(B4,FIND("//",B4)+2,LEN(B4)-FIND("//",B4)-1-(RIGHT(B4)="/"))

How this formula works

The core of this formula is the MID function, which extracts the text in a URL starting with the character after “//”, and ending with the character before the trailing slash (“/”):

=MID(url,start,chars)

The url comes straight from B4.

The start is calculated using the FIND function like this:

FIND("//",B4)+2

FIND returns the position of the double slash (“//”) in the URL as a number, so we add 2 in order to start extracting at the next character.

Chars represents the number of characters to extract. We calculate this using the following expression:

LEN(B4)-FIND("//",B4)-1-(RIGHT(B4)="/")

The LEN function calculates the length of the original URL, from which we subtract the position of “//” minus 1. we also use a bit of Boolean logic to conditionally subtract 1 more character:

(RIGHT(B4)="/")

Here the RIGHT function extracts the last character which is compared to “/”. A result of TRUE is evaluated as 1, while a result of FALSE is evaluated as 0.

The Boolean logic is used to avoid additional conditional logic.

Post navigation

Previous Post:

DECIMAL function: Description, Usage, Syntax, Examples and Explanation

Next Post:

AVERAGE function: Description, Usage, Syntax, Examples and Explanation

Leave a Reply Cancel reply

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

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IF, AND, OR and NOT Functions Examples in Excel
  • IF with boolean logic in Excel
  • SWITCH function: Description, Usage, Syntax, Examples and Explanation
  • Return blank if in Excel
  • Invoice status with nested if in Excel

Date Time

  • How to get Weekdays, Working days between Two Dates in Excel
  • Convert date to text in Excel
  • Series of dates by day
  • SECOND function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate nth day of week in month in Excel

Grouping

  • Categorize text with keywords in Excel
  • Running count group by n size in Excel
  • If cell contains one of many things in Excel
  • Group numbers at uneven intervals in Excel
  • Map text to numbers in Excel

General

  • Excel Autofill Cell Ranges, Copy, Paste
  • Split Cell Content Using Text to Columns in Excel
  • 44 Practical Excel IF function Examples
  • Subtotal invoices by age in Excel
  • How to test a range for numbers in Excel
© 2025 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning