How to Extract Substring in Google Sheets (With Examples)

Google Sheets provides several functions to extract substring from a string. Examples of such functions are LEFT, RIGHT, MID and FIND. These functions allow you to extract a part of a string from the left, right or middle. The FIND function is used to search for a specific character or string of characters within a larger string. You can then use the LEFT, RIGHT or MID function to extract the substring that you are looking for. With a few simple steps, these functions can help you easily extract the desired substring from a larger string.


You can use the following formulas to extract certain substrings from text in Google Sheets:

Method 1: Return Substring from Beginning of String

#return first 4 characters of string in cell A1
=LEFT(A1, 4)

Method 2: Return Substring from Middle of String

#return 4 characters of string in cell A1 starting at position 2
=MID(A1, 2, 4)

Method 3: Return Substring from End of String

#return last 4 characters of string in cell A1
=RIGHT(A1, 4)

Method 4: Return Substring Before Certain Text

#return all text before the string "there" in cell A1
=LEFT(A1, SEARCH("there", A1)-1)

Method 5: Return Substring After Certain Text

#return all text after the string "there" in cell A1
=RIGHT(A1, SEARCH("there", A1)-1)

The following examples show how to use each of these methods in practice.

Method 1: Return Substring from Beginning of String

The following screenshot shows how to use the LEFT() function to return the first three characters from cell A2:

Method 2: Return Substring from Middle of String

The following screenshot shows how to use the MID() function to return the five characters in the middle of cell A2, starting at position 4:

Method 3: Return Substring from End of String

The following screenshot shows how to use the RIGHT() function to return the last three characters from cell A2:

Method 4: Return Substring Before Certain Text

The following screenshot shows how to use the LEFT() and SEARCH() functions to return all of the text that comes before the string “there” in cell A2:

Method 5: Return Substring After Certain Text

The following screenshot shows how to use the RIGHT() and SEARCH() functions to return all of the text that comes after the string “there” in cell A2:

The following tutorials explain how to perform other common operations in Google Sheets:

x