How to extract first/last n characters from string in Excel? (2024)

For instance, there is a list with long strings in each cell, and you want to extract the first n characters from each string only, like the first 3 characters of each string, and now you can use the following methods to solve it in Excel.

Extract first/last n characters from string with formula

Extract first/last n characters from string with Kutools for Excel

Quickly remove special characters(numeric/alpha) from cells in Excel

Just several clicks with Remove Characters utilty of Kutools for Excel, the special characters will be removed from cells at once.
Click for free trial in 30 days!
How to extract first/last n characters from string in Excel? (1)
Kutools for Excel: with more than 300 handy Excel add-ins, free to try with no limitation in 30 days.

How to extract first/last n characters from string in Excel? (2) Extract first/last n characters from string with formula

Amazing! Using Efficient Tabs in Excel Like Chrome, Edge, Firefox and Safari! Save 50% of your time, and reduce thousands of mouse clicks for you every day!

Extract first n characters from string

Select a blank cell, here I select the Cell G1, and type this formula =LEFT(E1,3) (E1 is the cell you want to extract the first 3 characters from), press Enter button, and drag fill handle to the range you want. Then you see the first 3 characters are extracted.

How to extract first/last n characters from string in Excel? (4)

If you want to extract the last n characters, like the last 3 characters, type this formula = RIGHT(E1, 3).

How to extract first/last n characters from string in Excel? (5)

How to extract first/last n characters from string in Excel? (6) Extract first/last n characters from string with Kutools for Excel

The Remove by Position feature of Kutools for Excel also can extract the first or last n characters only from strings in Excel.

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 30 days. Get it Now

1. Select the range you want to extract first 3 characters firstly, and click Kutools > Text Tools > Remove by position. See screenshot:

How to extract first/last n characters from string in Excel? (7)

2. In the Remove by Position dialog, you need to type the number of the characters you want to remove from the string into the Numbers textbox, like in this case, I want to reserve the first 3 characters, so I need to remove 8 characters from right, then check From right. See screenshot

How to extract first/last n characters from string in Excel? (8)

3. Click Ok, and you see only the first 3 character are reserved.

How to extract first/last n characters from string in Excel? (9)How to extract first/last n characters from string in Excel? (10)How to extract first/last n characters from string in Excel? (11)

Tip: If you want to extract the last 3 characters, check From left and specify the number of the characters you want to remove from the strings.

Note:

1. Applying this feature will change your original data, you’d better copy them firstly.

2. Only all the strings in each cell have the some characters long can this feature work.

Click here for more on Remove by Position.

Relative Articles:

  • Extract all but first/last character or word in 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 | ...
Featured Features: Grid Focus |Design View | Big Formula Bar ||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, ...) | (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...

How to extract first/last n characters from string in Excel? (12)

Read More... Free Download...

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!

Read More... Free Download...

Sort comments by

Oldest First

Newest First

Comments (8)

No ratings yet. Be the first to rate!

Ravi teja

#39501

This comment was minimized by the moderator on the site

A1

UAN 101371765394, want only this Specific number 101371765394

Then =MID(A1,4,LEN(A1))

Reply

Vignesh

#38414

This comment was minimized by the moderator on the site

Line No: 2 AADHAAR XXXX XXXX 7842 is already mapped with UAN 101371765394,101371765394

This is paragraph i want only this number 101371765394.How i can get only number what is the formula for this. Kindly help us

Reply

Cynthia Ferrera

#30296

This comment was minimized by the moderator on the site

So I want to build a formula to make a unique id number with a persons first three letters of last name and first 2 letters of first name and zeros to fill in the rest in total 8 characters? Did I ask correctly?

Reply

Sunny Cynthia Ferrera

#30297

This comment was minimized by the moderator on the site

Hi, Cynthia Ferrera, no one formula can finish that job, but you can use multiple formulas to handle it, if you are interested in the solution, you can view the screen. If you do not want to use such many formulas, you can try Kutools for Excel' Split Names function and Extract Text function to finish the task.

View Attachments(1 / 5)

matt

#29289

This comment was minimized by the moderator on the site

i'm trying to set up a formula in my current worksheet. i want to remove everything after the first 5 numbers. I cant use kutools app at work. I dont know how to add the formula in to my current one. Any thoughts? the 53090 is what i would want and that is located in cell Q. This is a break down of 75 different numbers for different groups. I have each set of numbers assigned to a different grouping. As of right now i manually have to keep removing the extra numbers from each cell.

=SUM(COUNTIFS($O$12:$O$193,"530",$Q$12:$Q$193,{"53090","53095"}))

Reply

Debbie matt

#29290

This comment was minimized by the moderator on the site

just use left

=left() click on the text you want to use, then the number of characters 5

Reply

Ankur Pratap Singh Debbie

#29291

This comment was minimized by the moderator on the site

hi, The Left/Right function works but it prints number as text. I mean when I try to apply the formula to extracted digits it do not give any output. I hope u understand what I am Trying to say

Reply

#22021

This comment was minimized by the moderator on the site

I love Kutools explanation needs to say this Kutools works only if the cells have the same number of characters. It won't work if the cells have different number of characters. For example, say I want to extract the first character of these FDIC board members ie, M, L and B. Kutools won't do it. But "=LEFT(E1,3)" in the first technique will work.
Martin J. Gruenberg
Lorraine Dennison
Barbara Ryan

Reply

Report

There are no comments posted here yet

Please leave your comments in English

Posting as Guest

How to extract first/last n characters from string in Excel? (2024)
Top Articles
Latest Posts
Article information

Author: Cheryll Lueilwitz

Last Updated:

Views: 6027

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Cheryll Lueilwitz

Birthday: 1997-12-23

Address: 4653 O'Kon Hill, Lake Juanstad, AR 65469

Phone: +494124489301

Job: Marketing Representative

Hobby: Reading, Ice skating, Foraging, BASE jumping, Hiking, Skateboarding, Kayaking

Introduction: My name is Cheryll Lueilwitz, I am a sparkling, clean, super, lucky, joyous, outstanding, lucky person who loves writing and wants to share my knowledge and understanding with you.