How to extract first/last n characters from string in Excel?
Extracting specific characters from strings in Excel is a common task, especially when dealing with data cleanup or preparation for analysis. Whether you need the first or last n characters from text entries, Excel provides robust tools to accomplish this with precision. This guide will demonstrate two effective methods: using straightforward Excel formulas and utilizing the advanced features of Kutools for Excel. Each approach caters to different needs, from simple extractions to handling larger datasets efficiently.

Extract first/last n characters from string with formula
In this section, I will show you how to use Excel formulas to extract the first or last N characters from cell strings in Excel.
Extract the first n characters from strings
Select a blank cell, here I select the Cell D6, enter the following formula and press Enter. And then drag the Fill Handle of this formula cell down to get the rest of the results.
=LEFT(B6,4) 
Extract the last n characters from strings
To extract the last n characters, like the last 4 characters, enter the following formula in a cell and press Enter. Then drag the Fill Handle of this formula cell down to get the rest of the results.
=RIGHT(B6,4) 
- B6 is the cell from which you want to extract characters.
- The number 4 indicates you will extract 4 characters from the string.
Easily extract first/last n characters from string with Kutools for Excel
Kutools for Excel offers a significant advantage for users who prefer not to rely on memorizing formulas. Its user-friendly interface and ability to quickly process large datasets make it an ideal tool for enhancing productivity and efficiency in Excel without the complexity of traditional formula-based approaches.
After installing Kutools for Excel, go to select Kutools > Text > Extract Text.
- In the Extract Text dialog box, you need to configure as follows:
- Stay in the Extract by location tab.
- Select the range you want to extract text from.
- Select the The first N characters or The last N characters option as you need and specify the number of characters you want to extract.
- Click OK.

- Another Extract Text dialog box pops up, you need to select a cell to output the extracted characters. Here I select D3.

Result
The first or last N characters has beed extracted from the cells of the selected range.

Kutools for Excel includes more than 300 handy Excel tools. Free to try with no limitation in 30 days. Get it Now
Mastering the techniques to extract first or last n characters from strings in Excel can significantly streamline your data processing tasks. Whether you choose the formula-based method for quick tasks or Kutools for Excel for more complex data sets, both methods provide reliable solutions that enhance your data manipulation capabilities. With these skills, you can ensure that your data is precisely formatted to meet the needs of your analyses, reports, or any other applications that require specific text manipulation.
Which method should you use?
| Situation | Recommended method | Why |
|---|---|---|
| You are comfortable using formulas | LEFT or RIGHT formula | Provides a quick solution using built-in Excel functions. |
| The extracted characters should update when the original text changes | LEFT or RIGHT formula, or Kutools for Excel with the formula option enabled | Both methods can insert formulas that update automatically when the source cells change. |
| You want to extract characters without writing formulas | Kutools for Excel | Lets you choose the first or last N characters from a dialog box. |
| You need to process a large range and keep static results | Kutools for Excel | Extracts the characters from the entire range at once and returns results that are not linked to the source cells. |
Frequently Asked Questions
Do LEFT and RIGHT count spaces and punctuation as characters?
Yes. Excel counts every letter, number, space, and punctuation mark as one character. For example, if a cell begins with a space, that space is included among the characters returned by the LEFT function.
How can I ignore unwanted spaces before extracting characters?
Use the TRIM function around the cell reference. For example, =LEFT(TRIM(B6),4) removes leading and trailing spaces before returning the first four characters. TRIM also reduces multiple spaces between words to a single space.
What happens if N is greater than the number of characters in the cell?
LEFT and RIGHT return the entire text string. They do not add extra characters or return an error when N is greater than the length of the text.
Why does the formula return a #VALUE! error?
This error usually occurs when the number of characters is negative. Make sure the num_chars argument in the LEFT or RIGHT formula is zero or a positive number.
Do the extracted results update when the original text changes?
Results created with LEFT or RIGHT update automatically. When using Kutools for Excel, select the option to insert the results as formulas if you want them to update with the source text. Otherwise, Kutools returns fixed results.
Relative Articles:
Best Office Productivity Tools
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...
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!
All Kutools add-ins. One installer
Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.
- All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
- One installer, one license — set up in minutes (MSI-ready)
- Works better together — streamlined productivity across Office apps
- 30-day full-featured trial — no registration, no credit card
- Best value — save vs buying individual add-in

