How to Remove Text after Character in Google Sheets (5 Methods)

While working with texts in Google Sheets, there may come a situation when we need to remove certain text after a character or symbol. It can become very tiring and tedious to achieve this manually. Luckily, Google Sheets provides us with some easy ways to remove text after a character. In this article, we will learn how to remove text after a character in 5 methods.


A Sample of Practice Spreadsheet


5 Methods to Remove Text after Character in Google Sheets

1. Applying the Find and Replace Option

Find and Replace can be very useful to remove text after a character in Google Sheets. It is quite easy to apply.

For this, you need to have a dataset first. We have a column with Employee Names on it in cells B5:B9. The first and last names are separated by a comma.

sample of remove text after character in google sheets

We want to get rid of the last names along with the comma and extract only the first names in cells C5:C9. These are the steps you need to follow:

  • First, Copy the table where the data is using the mouse or keyboard shortcut CTRL+C. In our example, we copy the B5:B9 table.

copying table for remove text after character using find and replace

  • Then Paste the whole table where you want the data table to appear. We want the first names to appear in cell C5 so we go to C5 and paste the table using CTRL+V.

pasting table for remove text after character using find and replace

  • Next, go to Edit > Find and replace or use CTRL+H on the keyboard to get the Find and replace popup.

find and replace popup

  • Now, In the popup window, type in ,.* in the Find box. Leave the Replace with box empty.
,.*

input data in find box

  • Then, check both Match case and Search using regular expressions and press Replace all.

  • Finally, press Done and only the first names of employees remain.

  • Therefore, this is how you use Find and replace to remove text after a character in Google Sheets.

final output of remove text after character in google sheets using find and replace


2. Using the LEFT and FIND Functions

The LEFT function can be used with the FIND function to remove text after a character in Google Sheets. It is one of the easier methods to learn. The LEFT function provides the substring from a cell containing a string starting from the left.

For this, you need to have a dataset first. For this, we have a column with Employee Names on it in cells B5:B9. We separate the first and last names by a comma.

We want to get rid of the last names along with the comma and show only the first names in cells C5:C9.

data table for left function

These are the steps you need to follow:

  • First, go to the cell where you want the data to appear and type in =LEFT followed by an opening parenthesis. In our example, We go to cell C5 and type in =LEFT(.

input left function to remove text after character in google sheets using left function

  • Then, type in the cell number where the data is located followed by a comma. We type B5, as the data is in cell B5 in our table.

input data location for left function

  • Next, type in FIND followed by an opening parenthesis. We type in FIND(.

input find function

  • Now, as the data is separated by a comma, we type , inside a quotation. This means that data before the comma sign will appear in your new cell. So we type in “,”.

“,”

  • Then, type in the cell name where the data is after a comma and close parentheses for the FIND function. In our case, we type in ,B5).

  • Now, type -1, as you don’t want the comma to appear in your changed column, and close parentheses for LEFT function. In our example we type -1). This is what the final formula looks like:
=LEFT(B5,FIND(",",B5)-1)

final formula to remove text after character in google sheets using left function

  • Finally, press ENTER and there you have a cell containing only the first portion of your data before a character. Copy this to the next columns and there you have your complete table.

final outcome after using left function to remove text after character in google sheets

Read More: How to Remove Last Character from String in Google Sheets


3. Applying TRIM Function with LEFT and FIND

TRIM function can be used along with LEFT and FIND functions to remove text after a character in Google Sheets.

Consider the dataset we had for the previous methods.

dataset for trim function to remove text after character

  • First, go to the cell where you want the data to appear and type in =TRIM followed by an opening parenthesis. In our example, We go to cell C5 and type in =TRIM(.

input trim function to remove text after character in google sheets

  • Then, type in LEFT followed by an opening parenthesis. In our example, type in LEFT( and type in the cell number where the data is, followed by a comma. We type B5, as the data is in cell B5 in our table.

input data location for left function

  • Next, type in FIND followed by an opening parenthesis. We type in FIND(.

input find function

  • Now, as the data is separated by a comma(,) we type , inside a quotation. This means that data before the comma sign will appear in your new cell. So we type in “,”.

  • Then, type in the cell name where the data is after a comma and close parentheses for the FIND function. In our case, we type in ,B5).

input data location for find function

  • Now, type -1, as you don’t want the comma to appear in your changed column and close parentheses for the LEFT function and as well as for the TRIM function. In our example we type -1)). This is how the final formula looks:
=TRIM(LEFT(B5,FIND(",",B5)-1))

final formula for trim function to remove text after character in google sheets

  • Finally, Press ENTER, and there you have a cell containing only the first portion of your data before a character. Copy this to the next columns and there you have your complete table.

Read More: Remove Everything after Character Using Google Sheets Formula


4. Remove Text with the REGEXREPLACE Function

REGEXREPLACE function can be used to remove text after a character in Google Sheets. It can be implemented in the following ways:

Consider the dataset we used for the above methods.

regexreplace dataset to remove text after character in google sheets

  • First, go to the cell where you want to show the data and type =REGEXREPLACE followed by an opening parenthesis. For our example, we go to cell C5 and type =REGEXREPLACE(.

input regexreplace

  • Then, type in the cell number where the data is currently located followed by a comma. In our example, as the data is in cell B5 we type B5,.

input data location for regexreplace

  • Now, type ,.+ inside a quotation as we want to replace the data after the comma. Then, type in a comma and close parentheses. So, we type ",.+",).
",.+"

final formula for regexreplace to remove text after character in google sheets

  • Therefore, this is how the final formula looks:
=REGEXREPLACE(B5,",.+",)
  • Finally, Press ENTER, and there you have a cell containing only the first portion of your data before a character. Copy this to the next columns and there you have your complete table.

final table for regexreplace to remove text after character in google sheets


5. Using the REGEXEXTRACT Function

REGEXEXTRACT can also be used to remove text after character in Google Sheets. Just follow the following steps:

Consider the dataset we used for the above methods.

dataset for regexextract

  • First, go to the cell where you want to show the data and type =REGEXEXTRACT followed by an opening parenthesis. For our example, we go to cell C5 and type =REGEXEXTRACT.

input regexextract to remove data after character in google sheets

  • Then, you type in the cell number where the data currently is located. Then type a comma. In our example we type B5,.

input cell number for regexextract function to remove text after character in google sheets

  • Now, type (.*) starting a quotation as we want to show this data. In our example, we type “(.*).
  • Then, type in COMMA SPACE and .* and close the quotation. We type in , .*” as we do not want to show anything after the comma.
"(.*), .*"

  • Then close parentheses for REGEXEXTRACT. This is how the final formula looks:
=REGEXEXTRACT(B5,"(.*), .*")

regexextract final formula

  • Finally, Press ENTER, and there you have a cell containing only the first portion of your data before a character. Copy this to the next columns and there you have your complete table.

final outcome of remove data after character using regexextract

Read More: How to Remove First Character in Google Sheets


Conclusion

In this article, we showed you how to remove text after a character in Google Sheets. We hope this article was useful to you. Keep on practicing the 5 methods that were shown here to get a grip on the concept.

Also, check out our other articles on OfficeWheel to keep on improving your Google Sheets work knowledge.


Related Articles

Maruf Niaz

Maruf Niaz

My Name is Niaz. As a regular Google Sheets user, I have a good understanding of the users' needs and bad experiences. In my articles, I will share my knowledge which I hope, will be helpful to you. My latest educational degree was BSc in Textile Engineering from Bangladesh University of Textiles.

We will be happy to hear your thoughts

Leave a reply

OfficeWheel
Logo