logo
search
Function Problems

How to Extract a Variable Site Name from a URL in Excel

Camila MilosovichCamila Milosovich Oct 16, 2026 869 views

Question details

The user needs to isolate and extract a variable-length SharePoint site name from a list of URLs using an Excel formula.

How to Extract a Variable Site Name from a URL using Excel Formulas
Product
Excel
Device & OS
not provided
Scenario
Working with a list of SharePoint URLs where the site name segment varies in character length (e.g., example6 vs example666) and needs to be cleanly extracted into a separate column.
Observed behavior
The user requires a dynamic formula that accurately locates and extracts just the site name portion of the URL regardless of its length, moving away from fixed-length text extraction approaches.
Before you start

Ensure your list of URLs follows a relatively consistent domain structure (e.g., the site name always appears between '.com/' and the next '/') so that your extraction formulas can accurately target the boundary characters.

Solution 1Recommended

Use MID and FIND Functions for Dynamic Boundaries

This method locates the exact starting and ending points of the variable segment, making it perfect for extracting text of any length located between specific URL markers.

By combining the MID function with the FIND function, Excel can dynamically calculate where the site name begins and ends based on the placement of slashes, completely eliminating the need for fixed character counts.

1
Select an empty cell

Click on the empty cell in the column where you want the extracted site name to appear, typically right next to your URL data.

2
Enter the dynamic boundary formula

Type the following formula: =MID(A1,FIND(".com/",A1)+5,FIND("/",A1,FIND(".com/",A1)+6)-FIND(".com/",A1)-6) (assuming your URL is in cell A1).

3
Apply to the rest of the column

Press Enter to extract the site name, then click and drag the fill handle (the small square at the bottom-right of the cell) down to apply the formula to the remaining URLs.

Use MID and FIND Functions for Dynamic Boundaries
Formula Breakdown: This formula specifically finds '.com/' to establish a starting point, then looks for the very next '/' to establish the endpoint, returning only the variable text nestled between them.
Advanced Data Processing

Extract Text from URLs Easily with WPS Spreadsheet

WPS Office Spreadsheet fully supports advanced text functions like MID, FIND, and array formulas. You can seamlessly manipulate URL data, extract specific strings, and utilize Flash Fill for quick pattern recognition without writing complex code.

  1. 1. Open your file in WPS: Launch WPS Spreadsheet and open the document containing your list of URLs.
  2. 2. Apply a text formula: Use the MID and FIND formulas exactly as you would in Excel to dynamically extract the variable site names.
  3. 3. Use Flash Fill for instant results: Alternatively, type the desired site name manually in the first row, select the cell below it, and press Ctrl+E. WPS will automatically detect the pattern and fill the remaining cells.
100% compatible with Microsoft Excel formulas and functionsBuilt-in Flash Fill (Ctrl+E) for lightning-fast data extractionLightweight application with faster file load timesFree to use with a familiar, easy-to-navigate spreadsheet interface
microsoft office alternative - wps office

Frequently Asked Questions

Why does my FIND formula return a #VALUE! error?

This error occurs if the specific text you are searching for (like '.com/') cannot be found within the referenced cell. Double-check your URL string to ensure it contains the exact characters specified in your FIND function.

Can I extract the site name using the Data tab instead of formulas?

Yes. You can use the 'Flash Fill' feature by typing the site name in the first row and pressing Ctrl+E. Alternatively, you can use the 'Text to Columns' feature under the Data tab, select 'Delimited', and set the forward slash (/) as your delimiter to split the URL into separate columns.

Is TEXTSPLIT available in older versions of Excel?

No, the TEXTSPLIT function is only available in Microsoft 365 and Excel for the web. If you are using an older desktop version like Excel 2019 or 2016, you should rely on the MID and FIND combination or use the Flash Fill feature.