How to Extract Substring in Google Sheets? 2

How to Extract Substring in Google Sheets?

Extracting substrings in Google Sheets allows users to isolate specific parts of a cell’s text or number value. This can be useful for organizing and manipulating data in a spreadsheet. To extract a substring, the user must use the “MID” function, which takes three arguments: the text or cell containing the original string, the starting position of the substring, and the number of characters to extract. This process can be further customized by using other functions such as “LEFT” or “RIGHT” to extract characters from the beginning or end of a string. Examples of how to use these functions are provided for a better understanding of the extraction process.

Extract Substring in Google Sheets (With Examples)


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:

Cite this article

stats writer (2024). How to Extract Substring in Google Sheets?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-to-extract-substring-in-google-sheets-with-examples-2/

stats writer. "How to Extract Substring in Google Sheets?." PSYCHOLOGICAL SCALES, 15 May. 2024, https://scales.arabpsychology.com/stats/how-to-extract-substring-in-google-sheets-with-examples-2/.

stats writer. "How to Extract Substring in Google Sheets?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-to-extract-substring-in-google-sheets-with-examples-2/.

stats writer (2024) 'How to Extract Substring in Google Sheets?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-to-extract-substring-in-google-sheets-with-examples-2/.

[1] stats writer, "How to Extract Substring in Google Sheets?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, May, 2024.

stats writer. How to Extract Substring in Google Sheets?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top