Remove characters from text
Let's say you want to split a text column of phone numbers formatted as 999-999-9999 into three columns of numbers: area code, prefix, and number. There are several ways to remove characters from text.What do you want to do?
Remove a specified number of characters from the right or left side of text
Remove a text string from a worksheet by using the Replace command
Remove a specified number of characters from the right or left side of text
To do this task, use the LEN, LEFT, and RIGHT functions.
Example
The example may be easier to understand if you copy it to a blank worksheet.
How to copy an example
- Create a blank workbook or worksheet.
- Select the example in the Help topic.
Note Do not select the row or column headers.
Selecting an example from Help
- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the
Formulastab, in theFormula Auditinggroup, click theShow Formulasbutton.
|
|
Function details
Remove a text string from a worksheet by using the Replace command
- Select the range of cells that you want to search.
If you want to search the entire worksheet, click any cell in the worksheet.
- On the
Hometab, in theEditinggroup, clickFind & Replace, and then clickReplace. - In the
Find whatbox, enter the text or numbers that you want to search for or choose a recent search from theFind whatdrop-down box.Note You can use wildcard characters in your search criteria.
-
If you want to specify a format for your search, click
Formatand make your selections in theFind Formatdialog box. - Click
Optionsto further define your search. For example, you can search for all of the cells that contain the same kind of data, such as formulas.In the
Withinbox, you can selectHomeorWorkbookto search a worksheet or an entire workbook. - In the
Replace withbox, enter the replacement characters and specific formats if necessary.If you want to delete the characters in the
Find whatbox, leave theReplace withbox blank. - Click
Find Next. - To replace the highlighted occurrence or all occurrences of the found characters, click
ReplaceorReplace All.
Note To cancel a search in progress, press ESC.
![]()