How to remove all but first x characters from cells in Excel?
If you have a column of text strings that you just want to keep the first two characters and remove all other characters from the cells, excepting remove them one by one, do you have any other quick ways to deal with this problem in Excel?
Supposing you have the following data range, now you need to remove all characters but first two characters, the following simple formula can help you.
1. Enter this formula into a blank cell, B1, for example, =LEFT(A1,2), see screenshot:
Tips: In the above formula, A1 is the cell that you want to use, the number 2 indicates the number of characters that you want to keep, you can change them to your need.
2. Then drag the fill handle down to the cells that you want to apply this formula, and all characters have been removed from the cells but only keep the first two characters of the string. See screenshot:
Note: If you want to remove all but the last two characters, you can use this formula: =RIGHT(A1,2), and you also can change A1 and number 2 to others as you need.
If you have installed Kutools for Excel, with its Remove by Position utility, you can quickly remove first or last x characters you don’t want, on the contrary, you can also remove all but first x characters.
|Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days.|
After installing Kutools for Excel, please do as follows:( Download and free trial Kutools for Excel Now ！ )
1. Select the cells that you want to remove all but the first two characters.
2. Click Kutools > Text > Remove by Position, see screenshot:
3. In the Remove by Position dialog box, enter a large possible number as longas your largest text string into the Numbers text box which means these characters will be removed, then select Specify under the Position section, and enter the number position where you want to remove the characters from, see screenshot:
4. Then click Ok or Apply button, in this case, all the characters have been removed from the text string but only leave the first two characters, see screenshots:
The Remove by Position feature also can help you to remove the first or last x characters you need. Take the above data for example, now, I want to delete the first two characters to get the following result:
After installing Kutools for Excel, please do as follows:
1. Select the data range that you want to remove the first two characters.
2. Apply this feature by clicking Kutools > Text > Remove by Position, in the popped out Remove by Position dialog box, specify the number of characters to be removed in Numbers textbox. And then check From left to remove the first x characters, and check From right to remove the last x characters under Position. You can view the result from the Preview pane. See screenshot:
3. Then click Ok or Apply button to get the result that you want.