How To Remove First, Last X Characters Or Certain Position Characters From Text In Excel?
Method 1: Remove first or last x characters from text strings with formulas
Method 2: Remove first or last x characters from text strings with User Defined Function
Method 3: Remove first, last x characters or certain position characters without any formulas
Method 4: Remove both first x and last x characters from text strings with formula
Method 1: Remove first or last x characters from text strings with formulas
Remove first x characters from the beginning of the text strings:
In Excel, you can use the RIGHT and LEFT functions to remove the certain number of characters from the beginning or the end of the strings, please do as this:
1. Type or copy the following formula in a blank cell C4 where you want to put the result:
and press Enter key to get the first result. See screenshot:
Note: In the above formula:
- A4 is the cell value that you want to remove characters;
- The number 2 means the number of characters you want to remove from the beginning of the text string.
2. Then, select the cell C4 and drag the fill handle down to the cells where you want to apply this formula, and all the first 2 characters have been removed from the text strings, see screenshot:
Remove last x characters from the end of the text strings:
If you need to remove the last several characters, you can use the LEFT function as the same as the RIGHT function.
Please enter or copy this formula into a blank cell:
and then drag the fill handle down to the cells that you want to apply this formula, and last 9 characters have been deleted from the text strings at once, see screenshot:
Note: In the above formula:
- A4 is the cell value that you want to remove characters;
- The number 9 means the number of characters you want to remove from the end of the text string.
Method 2: Remove first or last x characters from text strings with User Defined Function
Here is a User Defined Function which also can help you to remove first or last n characters from text strings, please do as this:
Remove first x characters from the beginning of the text strings:
1. Hold down the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
2. Click Insert > Module, and paste the following code in the Module Window.
Public Function removeFirstx(rng As String, cnt As Long)
removeFirstx = Right(rng, Len(rng) - cnt)
End Function
3. Then go back to the worksheet, and then enter this formula: =removefirstx(A4,2) into a blank cell, and then drag the fill handle down to get the results as you need, see screenshot:
Note: In the above formula:
- A4 is the cell that you want to remove characters;
- The number 2 indicates the number of characters you would like to remove from the beginning of the text string.
Remove last x characters from the end of the text strings:
To remove last n characters from the text strings, please apply the following User Defined Function:
Public Function removeLastx(rng As String, cnt As Long)
removeLastx = Left(rng, Len(rng) - cnt)
End Function
And then apply this formula: =removelastx(A4,9) to get the results as you need, see screenshot:
Note: In the above formula:
- A4 is the cell that you want to remove characters;
- The number 9 indicates the number of characters you would like to remove from the end of the text string.
Method 3: Remove first, last x characters or certain position characters without any formulas
Using the Excel functions to remove certain characters is not as directly as it is. Just take a look at the way provided in this method, which is no more than two or three mouse clicks. With the Remove by Position utility of the third party add-in Kutools for Excel, you can be easy to remove first, last or certain characters from the text string. Click to download Kutools for Excel! Please see below demo:
After installing Kutools for Excel, please apply Remove by Position according to these steps:
1. Select the range that you want to remove the certain characters. Then click Kutools > Text > Remove by Position. See screenshot:
2. Specify the following operations in the pop-up Remove by Position dialog box.
- (1.) Specify the number of characters to be deleted.
- (2.) Choose From left option under the Position section to delete the first n characters, see screenshot:
Tips: The Remove by Position utility also can help you to remove the last n characters or the certain characters from specific position.
Method 4: Remove both first x and last x characters from text strings with formula
Sometimes, you would like to remove characters from text strings on both sides, for example, you need to remove first 2 characters and last 9 characters at the same time. Here, the MID function can do you a favor.
1. Please enter or copy this formula into a blank cell:
and press Enter key to get the first result. See screenshot:
Note: In the above formula:
- A4 is the cell value that you want to remove characters;
- The number 3 is one more than the number of characters you want to remove from the left side;
- The number 11 is the total number of characters you want to remove.
2. Then, select the cell C4 and drag the fill handle down to the cells where you want to apply this formula, and all the first 2 and last 9 characters have been removed immediately from the text strings, see screenshot:
The Best Office Productivity Tools
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-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.

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!































