How to remove text after a specific character

We talked that how to remove all characters before the first match of the comma character in the previous post. And this post will teach you how to remove text after the first occurrence of the comma character in a text string in excel.

Remove text after a specific character

If you want to remove all characters after the first match of the comma character in a text string in Cell B1, you can create an excel formula based on the LEFT function and FIND function.

You can use the FIND function to get the position of the first occurrence of the comma character in a text in B1, then using the LEFT function to extract the left-most characters before the first comma. So you can remove the text after the first comma character in text. You can use the following formula:

=LEFT(B1,FIND(",",B1)-1)

Let’s see how this formula works:

 

=FIND(“,”,B1)-1

remove text after first comma11

This formula returns the position of the first match of the comma character in a text string in Cell B1, then subtract 1 by the position number to get the length of substring before the first comma, so it returns 5. And the returned value goes into the LEFT function as its num_chars argument.

 

=LEFT(B1,FIND(“,”,B1)-1)

remove text after first comma1

This formula extracts the left-most 5 characters from a text string in Cell B1.

So you can see that all characters after the first comma character in a text string are removed.

Remove Text after a specific character using FIND&Select command

x
How to Show All Named Ranges in Excel

You can also use the Find and Replace command to remove text after a specified character, just refer to the following steps:

1# Click “HOME“->”Find&Select”->”Replace…”, then the window of the Find and Replace will appear.

Remove text using Find Select command1

Remove text using Find Select command1

2# click “Replace” Tab, then type  ,* into the Find what: text box, and leave blank in the Replace with: text box.

remove text after first comma2

3# click “Replace All

remove text after first comma3

you will see that all characters after the first comma character are removed.


Related Formulas

Related Functions

  • Excel LEFT function
    The Excel LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.The LEFT function is a build-in function in Microsoft Excel and it is categorized as a Text Function.The syntax of the LEFT function is as below:= LEFT(text,[num_chars])…t)…
  • Excel FIND function
    The Excel FIND function returns the position of the first text string (sub string) within another text string.The syntax of the FIND function is as below:= FIND(find_text, within_text,[start_num])…
Related Posts

How to Get Text before or after Dash Character in Excel
get text before dash8

This post will guide you how to get text before or after dash character in a given cell in Excel. How do I extract text string before or after dash character in Excel. Get Text before Dash Character with Formula ...

How to Insert Dashes in Phone Numbers in Excel
inset dash phone number15

This post will guide you how to insert or add dashes in phone number with a formula in Excel. How do I add dashes to telephone numbers in a selected range in Excel. How to separate numbers with dashes in ...

Extract First or Last N Characters
extract first two character2

This post will guide you how to extract the first or last n characters from a text string in one cell in Excel. How do I get the first or last N characters from a string using an Excel formula. ...

Insert The File Path and Filename into Cell
insert filepath filename in cell5

This post will guide you how to insert the file path and filename into a cell in Excel. Or how to add a file path only in a specified cell with a formula in Excel. Or how to add the ...

Extract Part of Text String
extract part of text string3

This post will guide you how to extract part of text string from a cell in Excel. How do I extract a word from a text string in Excel. How to extract a substring from a text string in a ...

Sum if Cells Begin with Specific Text or Number in Another Cells
sum cells begin specific textor number2

This post will guide you how to sum cells if cells begin with a specific text or number in another column in excel. How do I sum if cells start with specific text or number in another cells in excel. ...

Fill Blank Cells with specific value (0 or null)
fill empty blank cell with value2

This post will teach you how to fill all blank cells with specific value, such as: 0 or any other values in excel. How to locate all blank cells and then fill in all the blanks with any specific value. ...

Delete Rows Based on Cell Value
remove rows based on values3

This post will guide you how to use the Find & Replace feature to delete or remove all rows based on certain cell value in Microsoft Excel. Or how to delete all rows that contain certain value with VBA code ...

How to Copy Formula without Changing Cell References
copy formula without changing reference7

This post will guide you how to copy formula without changing its cell references to make an exact copy in excel. How to copy and paste formulas or links without changing Cell References. How to copy exact formula from one ...

How to Check If the First Letter is capitalized
check if first letter capitalized4

This post explains that how to check if the first letter in a cell is capitalized or not in excel. How to write an excel Macro to check if the first letter in a specified cell is capitalized or not. ...

Sidebar