Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

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.

Delete last/first character if it is a comma or certain character with formula

Delete last/first character if it is a comma or certain character with Kutools for Excel


arrow blue right bubbleDelete last/first character if it is a comma or certain character with formula


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.

Notes:

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.


arrow blue right bubbleDelete last/first character if it is a comma or certain character with Kutools for Excel

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.

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:

  If you want to have a free trial ( 30-day) of this utility, please click to download it, and then go to apply the operation according above steps.


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    krishanh · 1 months ago
    To remove a line break which is the last character of a cell, use this formula: IF(RIGHT(A2,1)=CHAR(10),LEFT(A2,LEN(A2)-1),A2)
  • To post as a guest, your comment is unpublished.
    Marty · 5 months ago
    mistake in the formula
  • To post as a guest, your comment is unpublished.
    Excel FAn · 7 months ago
    Why 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.
      crystal · 6 months ago
      Good day,
      Sorry for the inconvenience. Which Office version do you use? Kutools for Excel can help you dealing with 80% Excel puzzles and improve 70% work efficiency. We will fix the bug in the next release as soon as possible.
  • To post as a guest, your comment is unpublished.
    chungdc · 2 years ago
    Hi, 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