Skip to content
xlsoffice. All Rights Reserved
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Lookup and Reference Examples

  • Excel Advanced Lookup using Index and Match Functions
  • How to reference named range different sheet in Excel
  • To count total rows in a range in Excel
  • VLOOKUP function: Description, Usage, Syntax, Examples and Explanation
  • Offset in Excel

Data Analysis Examples

  • Excel Frequency Function Example
  • How To Remove Duplicates In Excel Column Or Row?
  • Understanding Anova in Excel
  • Add Outline to Data in Excel
  • Subtotal function in Excel

Data Validation Examples

  • How To Create Drop-down List in Excel
  • Excel Data validation unique values only
  • Excel Data validation date in next 30 days
  • Excel Data validation require unique number
  • Excel Data validation must begin with

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:   How to extract substring 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:   How to get first word 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:   Extract word that begins with specific character 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:

Put names into proper case — Manipulating NAMES in Excel

Next Post:

How to create email address from name 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
  • How to Separate Text Strings in Excel
  • How to check cell contains which things in Excel
  • Change Case: Uppercase, Lowercase, Propercase in Excel
  • Remove file extension from filename in Excel
  • How to abbreviate names or words in Excel
  • EDATE function: Description, Usage, Syntax, Examples and Explanation
  • Display Date is workday in Excel
  • Calculate expiration date in Excel
  • Get fiscal quarter from date in Excel
  • How to calculate quarter from date in Excel
  • ACCRINTM function: Description, Usage, Syntax, Examples and Explanation
  • SLN function: Description, Usage, Syntax, Examples and Explanation
  • How to calculate Net Present Value (NPV) in Excel
  • COUPDAYS function: Description, Usage, Syntax, Examples and Explanation
  • ACCRINT function: Description, Usage, Syntax, Examples and Explanation
Acronyms, Abbreviations, Initialism & What They Stand For
© 2021 xlsoffice. All Rights Reserved | Teal Smiles