Skip to main content

How to delete string after nth character in Excel?

In some cases, you may want to remove all strings after nth character from cells in Excel. If you have few of cells needed to remove strings after nth character, you can delete them manually. However, if there are hundreds of cells, that must be tired to delete strings one by one. Now this tutorial tells you the quick ways to remove strings after nth character in Excel, please read the below details.

Remove all string after nth character with formula

Remove string in specific position by Remove by Position


arrow blue right bubble Remove all string after nth character with formula

You can use below formula to remove all string after nth character.

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

Take instance, you want to delete all strings after the third character, and select a cell and type this formula =LEFT(A1,3) into it, press Enter key and drag the autofill handle down to cells.

doc delete after nth character 1
doc delete after nth character 2

Tip: In above formula, you can change 3 to any nth as you need. For example, if you want to remove strings after 4th character, use this formula =LEFT(A1,4).


arrow blue right bubble Remove string in specific position by Remove by Position

If you have Kutools for Excel, you can use the Remove by Position to quickly remove strings after nth character, and also can specify how many characters you will remove.

Kutools for Excel, with more than 120 handy Excel functions, enhance your working efficiency and save your working time.

After free installing Kutools for Excel, please do as below:

1. Select the data range and click Kutools > Text > Remove by Position. See screenshot:

doc delete after nth character 3

2. In the Remove by Position dialog, type 999 into Numbers textbox, and the check Specify and type 4 into following textbox. You can see the results shown on the preview pane.

Tip: If you want to remove string after nth character, you just need to type n + 1 into the Specify textbox.

doc delete after nth character 4

3. Then click Ok or Apply. The string after 3rd has been removed from each cell.

Note: If you just want to remove 3 characters after 3rd character of the string, you can type 3 into Numbers textbox, and check Specify and type 4 into it.

doc delete after nth character 5

Click here to know more details about Remove by Position.

Click here to free download Kutools for Excel

Best Office Productivity Tools

🤖 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 Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create 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 Ranges & Columns ...
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 Toolsets12 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 Cells, ...)   |   ... and more

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...

Description


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!
Comments (4)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
data UPI-2080-SHN ANNY SMI-KKBK-XXXXXX-MB: SOCIETY MAINTENANCE MARCH 22 0000####### 01/03/22
Output :- SHN ANNY SMI
This comment was minimized by the moderator on the site
Hi, sunil, here is a code may help you.
Sub extractText()
    Dim xSplit, xStr As String
    Dim xPos As Integer
    Dim xArr As Variant
    Dim xRng, xSetRng As Range
    On Error Resume Next
    Set xRng = Application.InputBox("Select the cell you want to extract:", "Kutools for Excel", , , , , , 8)
    xSplit = Application.InputBox("Type the delimiter:", "Kutools for Excel", , , , , , 2)
    xPos = Application.InputBox("Type the nth delimiter:", "Kutools for Excel", , , , , , 1)
    Set xSetRng = Application.InputBox("Select a cell to place result:", "Kutools for Excel", , , , , , 8)
    xArr = Split(xRng.Text, xSplit)
    xSetRng.Value = xSplit + xArr(xPos)
End Sub

Copy and paste above code to the Microsoft Visual Basic for Applications window, and run the code, in first dialog, choose the cell that you use to extract, in second dialog, type the delimiter, here in your case is -, in third dialog, type the nth delimiter, here in your case, you extract the string after second -, type 2 into this dialog, in last dialog, choose the cell you place the extracted result.
Hope it do favor on you.
This comment was minimized by the moderator on the site
data :- UPI-205080-SWN AHONY SI-KKBK-XXXXXX-MB: SOCIETY MAINTENANCE MARCH 22 000080 01/03/22
Output needed as "SWN AHONY SI"
This comment was minimized by the moderator on the site
These are very clever tricks! Thank you so much.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations