## Excel remove last or trailing comma in a cell

Sometimes when importing data from other files into Excel spreadsheet application, you may find there are extraneous characters such as commas appearing at the end of the strings. This tutorial explains how to use a combination of the IF, RIGHT, LEFT and LEN functions to remove the trailing comma in a cell in Excel.

#### How to remove the last or trailing comma in a cell in Excel?

As the below screenshot shown, cells in column B contain the data from which you want to remove trailing commas. Please do as follows to achieve it.

Generic formula

=IF(RIGHT(A1,1)=",",LEFT(A1,LEN(A1)-1),A1)

Arguments

A1: Represents the cell contains the text string from which you want to remove trailing comma.

How to use this formula?

1. Select a blank cell to output the text after removing the trailing comma. In this case, I select D3.

2. Enter the below formula into it and press the Enter key. Select the result cell, and then drag its Fill Handle all the way down to apply the formula to other cells.

=IF(RIGHT(B3,1)=",",LEFT(B3,LEN(B3)-1),B3)

Then you can see all commas at the end of the strings are removed immediately.

Note: In this formula, B3 is the cell containing the text string from which you want to remove trailing comma. Please change it as you need.

How this formula works?

=IF(RIGHT(B3,1)=",",LEFT(B3,LEN(B3)-1),B3)

1. LEFT(B3,LEN(B3)-1)

• The LEN function calculates the total length of text string "Excel, handy, addin," and returns the result as 20;
• And then the LEFT function extract 19 (20-1=19) characters from the left side of the text string "Excel, handy, addin," and gets the result "Excel, handy, addin".

• Here determines whether the rightmost value in text string "Excel, handy, addin," is a comma. If a comma is detected at the end of the string, it returns "Excel, handy, addin", otherwise, returns the original text string "Excel, handy, addin,".

#### Related functions

Excel IF function
The Excel IF function performs a simple logical test which depending on the comparison result, and it returns one value if a result is TRUE, or another value if result is FALSE.

Excel RIGHT function
The Excel RIGHT function extracts a specific number of characters from the right side of the text string.

Excel LEFT function
The Excel LEFT function extracts the given number of characters from the left side of a supplied string.

Excel LEN function
The Excel LEN function returns the number of characters in a text string.

#### Related formulas

Remove The First Or Last Word From A String
This tutorial explains how to remove only the first or last word from the text string in a cell with formulas in Excel.

Remove First N Characters From Cell
This tutorial introduces two formulas to help you easily remove the first n characters from a cell in Excel.

Remove Line Breaks From Cells In Excel
This tutorial provides three formulas to help you removing line breaks (which are occurred by pressing Alt + Enter keys in a cell) from specific cells in Excel.

Remove Text From Cell By Matching The Content
This article shows you how to use the SUBSTITUTE function to remove part of text string from specified cells by matching content.

Remove Text From A Cell Based On Specific Position
This tutorial explains how to use formulas to remove text from a cell based on specific position in Excel.

### The Best Office Productivity Tools

#### Kutools for Excel - Helps You To Stand Out From Crowd

 🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions… Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ... Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup... Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List... Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Columns to Select Same & Different Cells ... Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

#### Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

• One second to switch between dozens of open documents!
• Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
• Increases your productivity by 50% when viewing and editing multiple documents.
• Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.