You can use the Find and Replace feature in Excel to find specific characters in cells and replace them with different characters.
One perk of the Find and Replace feature is that you can use the following wildcard characters to make specific replacements:
1. Replace All Characters Between Two Specific Characters
This particular example replaces the strings “this” and “that” along with all characters between these two strings.
2. Replace All Characters Before Specific Characters
This particular example replaces the string “this” along with all characters that come before this string in the cell.
3. Replace All Characters After Specific Characters
This particular example replaces the string “this” along with all characters that come after this string in the cell.
The following example shows how to use each method in practice.
Example 1: Replace All Characters Between Two Specific Characters
Suppose we have the following dataset that shows the name and position of various basketball players on some team:
Suppose we would like to replace all of the characters between the parentheses in each cell in the Position column.
To do so, highlight the cell range B2:B13.
Then type Ctrl + H to bring up the Find and Replace window.
Then type (*) in the Find what box and then leave the Replace with empty.
Once you click Replace All, the parentheses and all characters between them will be removed from each cell:
Example 2: Replace All Characters Before Specific Characters
Suppose we have the following dataset that shows the name and position of various basketball players on some team:
Suppose we would like to replace the string “ar” and all characters that come before this string in each cell in the Position column.
To do so, highlight the cell range B2:B13.
Then type Ctrl + H to bring up the Find and Replace window.
Then type *ar in the Find what box and then leave the Replace with empty.
Once you click Replace All, the “ar” and all characters before them will be removed from each cell:
Note: Each cell with a position of “Center” was unchanged since it didn’t contain the string “ar” anywhere in the cell.
Example 3: Replace All Characters After Specific Characters
Once again suppose we have the following dataset that shows the name and position of various basketball players on some team:
Suppose we would like to replace the string “ar” and all characters that come after this string in each cell in the Position column.
To do so, highlight the cell range B2:B13.
Then type Ctrl + H to bring up the Find and Replace window.
Then type ar* in the Find what box and then leave the Replace with empty.
Once you click Replace All, the “ar” and all characters after them will be removed from each cell:
Note: Each cell with a position of “Center” was unchanged since it didn’t contain the string “ar” anywhere in the cell.
Additional Resources
The following tutorials explain how to perform other common operations in Excel:
How to Replace #N/A Values in Excel
How to Replace Blank Cells with Zero in Excel
How to Substitute Multiple Values in Cell in Excel