Google Sheets: Extract Text Before a Character

Google Sheets is an incredibly powerful and versatile online spreadsheet application. It allows users to create, manipulate, store, and share data with others. One of the most useful features of Google Sheets is the ability to extract text before a character. This feature can be used to quickly and easily clean up messy data that has been imported from other files. This article will discuss the importance of the extract text before a character feature in Google Sheets, as well as how to use it.


You can use the following formula in Google Sheets to extract all text before a specific character in a cell:

=REGEXEXTRACT(A2,"(.*)our.*")

This particular formula extracts all of the text in cell A2 that occurs before the string “our” is encountered.

This formula uses the REGEXTRACT function to extract all characters (.*) before our.

The following example shows how to use this formula in practice.

Example: Extract Text Before Character in Google Sheets

Suppose we have the following list of phrases in Google Sheets:

Now suppose that we would like to extract all text from each cell before the string “our” is encountered.

To do so, we can type the following formula into cell B2:

=REGEXEXTRACT(A2,"(.*)our.*")

We can then click and drag this formula down to each remaining cell in column B:

Google Sheets extract text before character

Column B now displays all text before “our” for each phrase in column A.

To extract the text before a different specific character, we simply need to replace our with something else.

For example, we could type the following formula into cell B2 to extract all text before “is ” from cell A2:

=REGEXEXTRACT(A2,"(.*)is .*")

Column B now displays all text before “is ” for each phrase in column A.

Google Sheets: How to Extract Text After a Character


In conclusion, the REGEXEXTRACT formula is a powerful tool for extracting text before a specific character in Google Sheets. This formula uses a regular expression pattern that allows you to specify the characters before which you would like to extract text. By understanding this formula and how to apply it, you can quickly and easily extract text before specific characters in Google Sheets.

x