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

Data Analysis

  • How to Use Solver Tool in Excel
  • Use Data Form to input, edit and delete records in Excel
  • How To Sort One Column or Multiple Columns in Excel
  • Example of COUNTIFS with variable table column in Excel
  • Get column name from index in Excel Table

References

  • How to use Excel MATCH Function
  • Excel Advanced Lookup using Index and Match Functions
  • Complete List of Excel Lookup and Reference Functions, References and Examples
  • CHOOSE function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel INDIRECT Function

Data Validations

  • Excel Data validation number multiple 100
  • Excel Data validation no punctuation
  • Excel Data validation only dates between
  • Excel Data validation don’t exceed total
  • Excel Data validation must contain specific text

How to extract domain name from URL in Excel

by

If you want to extract the domain name from a complete URL, you can do so with a formula that uses  the LEFT and FIND functions. See example: In the formula below, url is the the URL you are working with.

Formula

=LEFT(url,FIND("/",url,9))

Explanation

In the example, we are using this formula:

=LEFT(B4,FIND("/",B4,9))

Here’s how the formula works:

B4 contains the URL: “ https://www.xlsoffice.com/data-analysis/excel-pie-chart/”

Worked Example:   Remove unwanted characters in Excel

At the core, this formula is extracting characters from the URL, starting from the left, and using the FIND function to figure out how many characters to extract.

First, FIND locates the “/” character in the URL, starting at the 9th character. This is the “clever” part of the formula. URLs begin with something called a “protocol” which looks like this:

Worked Example:   Get first name from full name — Manipulating NAMES in Excel

ftp://
sftp://
http://
https://

and so on. By starting at the 9th character, the protocol is skipped, and the FIND function will return the location of the 3rd instance of “/” (the first instance after the double slash in the protocol).

In this case, the third instance of “/” is the 21st character in the URL, so FIND returns the number 21.

Worked Example:   How to strip protocol and trailing slash from URL in Excel

The LEFT function then extracts 21 characters from the URL, starting at the left. The result is the domain name with a trailing slash.

If you want to get the domain name without a trailing slash, just subtract the number 1 from the the result of FIND like so:

=LEFT(B4,FIND("/",B4,9)-1)

Post navigation

Previous Post:

How to count line breaks in cell in Excel worksheet

Next Post:

How to count total words in a cell in Excel

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 with wildcards in Excel
  • FALSE function: Description, Usage, Syntax, Examples and Explanation
  • Check multiple cells are equal in Excel
  • AND function: Description, Usage, Syntax, Examples and Explanation
  • How to use Excel XOR Function

Date Time

  • Add decimal hours to time in Excel
  • Series of dates by day
  • Display Days in month in Excel
  • DAYS function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate project start date based on end date in Excel

Grouping

  • Map text to numbers in Excel
  • Categorize text with keywords in Excel
  • Group times into 3 hour buckets in Excel
  • Group numbers at uneven intervals in Excel
  • How to randomly assign people to groups in Excel

General

  • Currency vs Accounting Format in Excel
  • How to fill cell ranges with random text values in Excel
  • Check if multiple cells have same value with case sensitive in Excel
  • How to increase by percentage in Excel
  • With vs Without Array Formula in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning