---
title: "SEO Spreadsheet Tip: Keep Only the Domain with LEFT"
description: "This Google Sheets technique removes protocols, www, paths, and query strings from long URLs so that only the domain remains."
canonical: "https://www.darrenhuang.com/en/seo-spreadsheets-tip-left-function.html"
markdown: "https://www.darrenhuang.com/en/seo-spreadsheets-tip-left-function.md"
locale: "en"
language: "en"
translationKey: "post:seo-spreadsheets-tip-left-function"
type: article
published: "2016-04-26T00:00:00.000Z"
modified: "2023-06-26T00:00:00.000Z"
---

> This Markdown version is generated automatically from the HTML page.
> When citing this content, use the [canonical page](https://www.darrenhuang.com/en/seo-spreadsheets-tip-left-function.html).

Digital Engine article

# SEO Spreadsheet Tip: Keep Only the Domain with LEFT

This Google Sheets technique removes protocols, www, paths, and query strings from long URLs so that only the domain remains.

Darren Huang·April 26, 2016·2-min readUpdated June 26, 2023

Originally published in Chinese on April 26, 2016. This English translation preserves the original context; referenced products, interfaces, and policies may have changed.

Table of contents6 sections

1.  [Introduction](#section-introduction)
2.  [Step 1: remove the prefixes](#section-step-1-remove-the-prefixes)
3.  [Step 2: keep the domain](#section-step-2-keep-the-domain)
4.  [Breaking down FIND](#section-breaking-down-find)
5.  [SEO applications](#section-seo-applications)
6.  [Conclusion](#section-conclusion)

**Table of contents**

1.  [Introduction](#section-introduction)
2.  [Step 1: remove the prefixes](#section-step-1-remove-the-prefixes)
3.  [Step 2: keep the domain](#section-step-2-keep-the-domain)
4.  [Breaking down FIND](#section-breaking-down-find)
5.  [SEO applications](#section-seo-applications)
6.  [Conclusion](#section-conclusion)

SEO work often involves a large number of external links. URLs may contain `http://`, `www.`, long paths, and query strings, even though the domain name is the part we need. The **`=LEFT()` function** can clean these URLs so they are ready for the next step.

![Keeping only the domain name with the LEFT function](/wp-content/uploads/2016/04/left-function.jpg)

## Introduction

This walkthrough uses Google Sheets. You can copy the sample from [this spreadsheet](https://docs.google.com/spreadsheets/d/1KjlM2Y2EFlH-x9UWOmI3Mf5o1LFbbPyPlNATujO4JaQ/edit?usp=sharing) into your own sheet and follow along.

## Step 1: remove the prefixes

Use Find and replace three times to replace `http://`, `https://`, and `www.` with nothing.

![Finding and replacing everything before the domain name](/wp-content/uploads/2016/04/Find-and-replace.jpg)

1.  Select the range `A2:A14`.
2.  Choose Edit → Find and replace (Ctrl+H).
3.  Find `http://`, leave Replace empty, and choose Replace all.
4.  Repeat for `https://` and `www.` (do not forget the period).

![Spreadsheet after removing URL prefixes](/wp-content/uploads/2016/04/after-find-and-replace.jpg)

## Step 2: keep the domain

In B2, enter:

```
=LEFT(A2,FIND("/",A2,1)-1)
```

LEFT takes a string and a number, then keeps that many characters. For example, `LEFT("D.H. Digital Marketing Notes",5)` keeps the first five characters. FIND locates the first slash, and subtracting one prevents the slash from being included.

Because every domain has a different length, this formula works for both short and long domains, such as `fau.edu/...` and `valenciacollege.edu/...`. The formula finds the first slash and returns everything before it.

### Breaking down FIND

-   `"/"` is the character to find.
-   `A2` is the cell containing the URL.
-   `1` tells Sheets to start at the first character.
-   `-1` removes the slash from the final result.

> `FIND("/",A2,1)-1` means: find the first slash in A2 and return the position immediately before it.

## SEO applications

This is useful when an SEO tool expects a domain rather than a complete URL, such as when checking domain authority. It is also useful when disavowing bad backlinks at the domain level.

## Conclusion

This formula may seem basic, but it is a practical way to remove the unnecessary parts from a large URL list. If you know a better spreadsheet method, feel free to share it. Thanks for reading.

**Categories**

-   [Uncategorized](/en/categories/uncategorized.html)

**Topics**

-   [Uncategorized](/en/tags/uncategorized.html)

Keep exploring

## Keep reading

[All articles →](/en/articles.html)

### Related articles

May 18, 2016

#### [SEO | Everything You Need to Know About Anchor Text](/en/seo-anchor-text-and-google-bomb.html)

[Read article →](/en/seo-anchor-text-and-google-bomb.html)

June 19, 2016

#### [SEO| Bookmarklets - A practical tool for SEO](/en/seo-efficient-tool-bookmarklets.html)

[Read article →](/en/seo-efficient-tool-bookmarklets.html)

November 23, 2015

#### [SEO | 2015.11.17 Moztalk participation experience](/en/what-i-learned-from-moztalk.html)

[Read article →](/en/what-i-learned-from-moztalk.html)

×

Open full-size image ↗
