How to Remove Protocol From Url in Excel

Learn multiple Excel methods to remove protocol from url with step-by-step examples and practical applications.

excelformulaspreadsheettutorial
9 min read • Last updated: 7/2/2025

How to Remove Protocol From Url in Excel

Why This Task Matters in Excel

Every day, analysts, marketers, and IT professionals exchange spreadsheets packed with website addresses. In most cases the receiving system, report, or dashboard only needs the “domain + path.” The protocol—such as http://, https://, ftp://, or file://—is redundant, and sometimes it even breaks downstream logic. For instance, campaign-tracking tools often concatenate “https://” automatically. If your exported data already contains the protocol, you end up with malformed URLs like https://https://company.com/landing.

Removing the protocol is also crucial for data comparison. Imagine a cybersecurity analyst cross-checking a list of suspicious domains against an internal whitelist. If one list contains https://example.net and the other contains example.net, a direct lookup fails—forcing manual cleanup. In e-commerce, the warehouse team could run into mismatched URLs when printing QR codes that must exclude protocols to stay under character limits.

Excel shines at quick data transformations, especially when the dataset is not large enough to justify a database or ETL pipeline. You can apply a single formula down thousands of rows, use Flash Fill to recognize patterns, or push the data into Power Query for a no-code solution. Every method is fast, repeatable, and auditable. Failing to strip protocols can lead to inflated file sizes, duplicate records, broken hyperlinks, or incorrect analytics attribution—all of which translate to wasted time and money. Mastering the removal of protocols therefore links directly to better data hygiene, reliable reporting, and smoother integration with other Excel-centric workflows such as VLOOKUP‐based matching, PivotTables, and dashboards that rely on clean URL strings.

Best Excel Approach

The most robust, version-agnostic formula uses SUBSTITUTE in combination with IF to handle both http:// and https:// without double-stripping mid-string occurrences. The logic is simple: if the text begins with a known protocol, replace it with an empty string; otherwise return the original URL.

Syntax for a single-protocol variant:

=SUBSTITUTE(A2,"http://","")

Comprehensive two-protocol solution:

=IF(LEFT(A2,8)="https://",
     SUBSTITUTE(A2,"https://",""),
     IF(LEFT(A2,7)="http://",
        SUBSTITUTE(A2,"http://",""),
        A2))

In Microsoft 365 or Excel 2021, the new TEXTAFTER function reduces complexity:

=TEXTAFTER(A2,"://")

TEXTAFTER locates the first occurrence of \"://\" and returns everything to the right. This works regardless of the protocol’s length (ftp://, sftp://, etc.). Use ,1-based optional parameters to control which delimiter instance to target if “://” appears later in the string, though that is rare in URL stems.

Choose SUBSTITUTE when you must support Excel 2016 or earlier. Opt for TEXTAFTER when everyone in your organization runs the Microsoft 365 subscription because it is cleaner, faster, and automatically ignores case.

Parameters and Inputs

  1. Source cell – typically text in [A2] or any column. It must be recognized as plain text; numeric or error values will propagate errors.
  2. Protocol delimiter – "http://" or "https://" in the SUBSTITUTE version, or "://" in TEXTAFTER. This is case-sensitive in older Excel versions; ensure lowercase to match standard URLs.
  3. Occurrence number (optional in TEXTAFTER) – defaults to first instance. Set to 2 if your string might contain an embedded credential such as https://user:pass@example.com.
  4. Default return – with IFERROR, you can specify what happens when the delimiter is missing:
=IFERROR(TEXTAFTER(A2,"://"),A2)

Data preparation tips:

  • Trim leading/trailing spaces with TRIM if URLs come from copy-paste.
  • Use CLEAN to remove non-printing characters from scraped lists.
  • Validate with ISTEXT to catch accidental numeric IDs or nulls.
    Edge cases include protocol-less URLs already in the desired shape (our formulas return them untouched) and malformed strings like https:///example.com which may leave an empty leading slash.

Step-by-Step Examples

Example 1: Basic Scenario

Imagine a marketing intern receives a CSV containing 500 landing-page URLs in column A. The analytics platform later appends “https://” automatically, so the intern must strip existing protocols.

  1. Open the CSV and insert a new heading in [B1]: URL_No_Protocol.
  2. In [B2] type:
=IF(LEFT(A2,8)="https://",
     SUBSTITUTE(A2,"https://",""),
     IF(LEFT(A2,7)="http://",
        SUBSTITUTE(A2,"http://",""),
        A2))
  1. Press Enter and double-click the fill handle to copy down 500 rows.
  2. Spot-check: the original https://company.com/home becomes company.com/home; the plain string news.company.com/about remains unchanged.
  3. Copy [B] and use Paste Special → Values to freeze the result, then delete column A if needed.

Why it works:

  • LEFT quickly confirms whether the protocol sits at the beginning, avoiding accidental substitution of “http://” deeper in a query string.
  • SUBSTITUTE replaces only that first match because URLs rarely contain “http://” twice.
    Troubleshooting: if you see #VALUE!, the cell might contain more than 32,767 characters or be non-text; wrap with IFERROR or convert numbers to text via TEXT or '.

Example 2: Real-World Application

A compliance officer audits supplier portals. The master inventory lists domains only, while exported logs from a firewall monitoring tool list full URLs. To perform a VLOOKUP, you need to homogenize both lists.

Data setup:

  • Sheet Import column A: full URLs like https://portal.vendor-a.org/login.aspx?usr=joe.
  • Sheet Master column A: vendor domains like portal.vendor-a.org.

Steps:

  1. In Sheet Import, create column B header NormalizedDomain.
  2. Enter the modern formula in [B2]:
=TEXTAFTER(A2,"://")
  1. Copy the formula down 20,000 rows; Excel’s Spill engine auto-renders instantly on Microsoft 365.
  2. To isolate only the host without the path, nest TEXTBEFORE:
=TEXTBEFORE(TEXTAFTER(A2,"://"),"/")
  1. Flip over to Sheet Master. In column B add:
=IFNA(VLOOKUP(A2,Import!B:B,1,FALSE),"Not found")
  1. Filter results to identify missing suppliers.

Business impact: the audit, previously involving manual copy-paste and 4 hours of work, now completes in under 5 minutes. Integration: the extracted host works seamlessly with PivotTables for frequency counts and with Conditional Formatting to flag high-risk domains. Performance: TEXTAFTER plus TEXTBEFORE processes 20,000 rows in milliseconds because both functions are optimized native C++ routines and avoid volatile dependencies.

Example 3: Advanced Technique

Some SaaS platforms embed credentials in URLs: https://user:pass@secure.example.com:8080/dashboard. You need to strip both the protocol and the credentials while preserving the host and optional port.

Formula (365 only):

=LET(
     raw, A2,
     noProto, TEXTAFTER(raw,"://"),
     noCreds, IF(ISNUMBER(SEARCH("@",noProto)),
                 TEXTAFTER(noProto,"@"),
                 noProto),
     noCreds
)

Explanation:

  • LET stores intermediate values without recalculating.
  • SEARCH checks for “@” which splits credentials from the host.
  • If “@” exists, TEXTAFTER grabs everything to the right; otherwise, keep the original.

Edge cases: for bare domains with no credentials, the formula returns instantly with minimal overhead. For complex URLs, the process is O(1) because each text function scans the string once.

Professional tips:

  • Wrap the final result in LOWER to standardize case before joining with other case-sensitive systems.
  • Append ":"&TEXTAFTER(noCreds,":",2) inside LET if you must keep custom ports.
  • Use FILTER to flag records where SEARCH("@",noProto) returns a number, which may violate security policy.

Tips and Best Practices

  1. Keep a dedicated “working” column so the original URL remains intact for auditing.
  2. Combine TRIM and CLEAN with your main formula for bullet-proof ingestion from emails or PDFs.
  3. Store formula snippets in Excel’s AutoCorrect or a personal macro workbook to reuse quickly.
  4. Use dynamic array formulas (TEXTAFTER, TEXTBEFORE) when targeting Microsoft 365; they calculate faster and spill automatically.
  5. After transformation, convert formulas to values before sharing workbooks externally to prevent accidental recalculation errors.
  6. For large datasets, perform the operation in Power Query then load as a connection—this keeps the main worksheet light and refreshable.

Common Mistakes to Avoid

  1. Substituting “http://” without checking position can corrupt query strings that legitimately include “http://” later. Fix: wrap in LEFT or TEXTBEFORE.
  2. Forgetting to add the trailing slashes in the SUBSTITUTE target leads to partial words removed (e.g., “http” inside httpStatus). Fix: always use "://" delimiter.
  3. Using case-sensitive search in inconsistently cased data. Fix: wrap source in LOWER and lower-case the delimiter.
  4. Overwriting original data without backup. Fix: create a duplicate column or save a versioned copy.
  5. Applying formulas to entire columns in pre-2007 workbooks with 65,536 rows, causing “Calculation chain exceeded” sluggishness. Fix: convert the range to an Excel Table so formulas apply only to populated rows.

Alternative Methods

MethodProsConsBest For
TEXTAFTERShort, automatic spill, supports any protocol lengthMicrosoft 365 onlyModern environments
SUBSTITUTE + IFCompatible back to Excel 2007, straightforwardNeeds separate checks for http and httpsMixed-version teams
FIND + MIDFine-grained control over positionMore complex, easy to mis-offsetEducational demos
Flash FillNo formulas, intuitiveManual trigger, brittle under changeOne-off cleanups
Power QueryGUI driven, refreshable, huge datasetsInitial setup timeScheduled imports or millions of rows

When choosing, weigh compatibility versus elegance. Upgrade paths: once the team migrates to Microsoft 365, convert SUBSTITUTE logic to TEXTAFTER for readability. For recurrent tasks, a Power Query transformation with a “Replace Values” step is future-proof.

FAQ

When should I use this approach?

Use formula-based stripping for quick, ad-hoc datasets under a few hundred thousand rows, especially when you need immediate calculation on the sheet. Switch to Power Query when the task recurs regularly or data exceeds one million rows.

Can this work across multiple sheets?

Yes. Simply reference the source sheet:

=TEXTAFTER(Sheet1!A2,"://")

Dynamic array formulas will still spill within the target sheet.

What are the limitations?

TEXTAFTER cannot be nested inside older Excel; it requires Microsoft 365 or Excel 2021. SUBSTITUTE is case-sensitive, and both methods assume the delimiter exists only once near the start. Malformed URLs with spaces may yield unexpected output.

How do I handle errors?

Wrap the formula with IFERROR to return the original URL or a blank string. In Power Query, use the “Replace Errors” step to set a default value.

Does this work in older Excel versions?

SUBSTITUTE + IF works back to Excel 2007. For Excel 2003, use MID(A2,FIND("://",A2)+3,255). Flash Fill is unavailable before 2013.

What about performance with large datasets?

On modern processors, TEXTAFTER processes around 1.5 million rows in under five seconds. With SUBSTITUTE, expect similar speed but ensure calculation mode is set to Manual when pasting gigantic lists to prevent UI freezes.

Conclusion

Cleaning URLs by removing their protocols is a deceptively simple task with outsized benefits: reduced data redundancy, successful lookups, and fewer integration headaches. Whether you rely on the elegant TEXTAFTER function, backward-compatible SUBSTITUTE, or a GUI-driven Power Query step, Excel offers a solution that matches every skill level and environment. Master this technique today and you’ll streamline web analytics, compliance audits, and countless other workflows—cementing your status as the spreadsheet troubleshooter everyone relies on.

We use tracking cookies to understand how you use the product and help us improve it. Please accept cookies to help us improve.