How to remove last/first character if it is a comma or certain character in Excel?
For a range of data, you may want to delete the last or first character if it is a comma or other character in Excel. This article will show you two methods to achieve it.
Recommended Productivity Tools for Excel
Office Tab: Bring powerful tabs to Office (include Excel), just like Chrome, Safari, Firefox and Internet Explorer. Save you half the time, and reduce thousands of mouse clicks for you. 30-day Unlimited Free Trial
Kutools for Excel: Save 71% of your time and solve 82% Excel problems for you. 300+ advanced tools designed for 1500+ work scenario, make Excel much easy and increase productivity immediately.60-day Unlimited Free Trial
You can apply the following formulas to delete the last or first character if it is a comma or certain character in Excel.
1. Select a blank cell (says C1) in the help column, enter formula =IF(RIGHT(A1,1)=",",LEFT(A1,LEN(A1)-1),A1) into the Formula Bar, and then press the Enter key.
1. In the formula, A1 is the cell with last character you need to remove, “,” is the comma symbol which belongs to the last character of cell A1. You can change the comma symbol to any other character as you need.
2. You can apply this formula =IF(LEFT(A1,1)=",",RIGHT(A1,LEN(A1)-1),A1) to remove the first character if it is a comma.
2. Keep selecting cell C1, then drag the Fill Handle to the corresponding cells for deleting all last characters if they are met the condition. Then you can see all commas after the specified cells are removed as below screenshot shown.
This section will show you the Select Specific Cells utility and the Delete by Position utility of Kutools for Excel. With these two utilities, you can easily select all cells which end or begin with certain character, and then remove them from the selected cells at once.
|Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.|
1. Select a range of cells you want to find cells end or begin with certain character, then click Kutools > Select > Select Specific Cells. See screenshot:
2. In the Select Specific Cells dialog box, select the Cell option in the Selection type section, and in the Specific type section, choose Ends with or Begins with from the first drop-down list and then type a comma or other character you need into the following textbox, and finally click the OK button.
Note: If you need to select cells with two criteria, for example select all cells which end with comma and cells end with character “n”, please enable these two conditions with selecting the And option, choose Ends with or Begins with from the two drop-down lists, and then type comma mark and the character “n” into the textboxes consecutively.
3. Then a dialog box pops up to tell you how many cells are selected, click the OK button and all qualified cells are selected immediately. Now you need to click Kutools > Text > Remove by Position.
4. In the Remove by Position dialog box, enter number 1 into the Numbers box, select From right to remove the last character or From left to remove the first character in the Position section (here we select the From right option), and then click the OK button.
You can see all last characters of selected cells are removed immediately. See screenshot:
|You can download and try the free trial now!|
Recommended Productivity Tools
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.· 26 days agoWhy is that every time I try to use KUTOOL , It crashes the application and close out the excel without saving. Its frustrating . Can someone help. It looks like cool tool to use
To post as a guest, your comment is unpublished.· 1 years agoHi, I am trying to remove initials that exist at the end of some names in a list, using this method. My formula is =IF(LEFT(A1,2)=",",RIGHT(A1,LEN(A1)-2),A1) so that John S becomes John. Thanks