Skip to main content

How to replace all after/before specific character or space in Excel?

Author: Kelly Last Modified: 2024-11-13

A screenshot of an Excel worksheet showing a text list with characters to be replaced

For example you have a list of text strings as below screenshot shown, and now you need to replace all characters after the specific “b” with another text string in Excel. Any idea to solve it in Excel quickly? This article will introduce two easy solutions for you.

 

Replace all after/before specific character or space with Find and Replace feature

Replace all after/before specific characters of space with Kutools for Excel


Replace all after/before specific character or space with Find and Replace feature

This method will introduce the Find and Replace feature to easily replace all characters after or before specified one in Excel. Please do as follows:

1. Select the list you will replace all after/before the specific characters, and press the Ctrl + H keys simultaneously to open the Find and Replace dialog box.

Note: You can also open the Find and Replace dialog box by clicking Home > Find & Select > Replace.

2. In the Find and Replace dialog box, please do as follows:
(1) In the Find what box, please type b*;

Note: b is the specific character you will replace all characters after. To remove all before the specific character, please type *b into the Find what box. To replace all characters after (before) space, please type a space and * (or * and a space) into this box.

(2) In the Replace with box, please type the text string you will replace with.
(3) Click the Replace All button.
A screenshot of Find and Replace dialog box in Excel with replacement settings

3. Now a dialog box will come out and show how many replacements it has made. Just click the OK button to close it. And then close the Find and Replace dialog box.
A screenshot of a confirmation dialog

And now in our example you will see all characters after b has been replaced with the specified text in the selected cells. See screenshot:
A screenshot of an Excel list showing characters replaced after a specific character

Note: This method does not work if you want to replace all characters after/before wildcards (* and ?).

Remove characters from beginning/right/end in cells

Kutools for Excel's Remove By Position feature eases you removing certain number of characters from beginning/end/specified position of text string in cells.

A screenshot of Kutools Remove By Position tool's interface and use case example

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now

Replace all after/before specific characters of space with Kutools for Excel

No matter replacing all characters after/before a normal character (such as a letter, number, etc.), or replacing all after/before a special character (such as *, ?, etc.), Kutools for Excel can help you easily get it done in Excel.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. Select the list of text strings you will replace all before/after the specific character, and click Kutools > Text > Split Cells.
A screenshot of Kutools Text menu highlighting the Split Cells option and the Split Cells dialog

2. In the opening Split Cells dialog box, please check the Split to Columns option, check the Other option and type the specific character (we type the asterisk * in our example) into below box, and click the Ok button. See screenshot:

In the second Split Cells dialog box please specify the first cell of destination range and click the OK button.
A screenshot of the Split Cells dialog with destination range selection

And then you will see the list of text strings are split into two columns. See screenshot:

A screenshot of split text strings in Excel, separated by specified characters

3. Select the first column of two split columns, and click Kutools > Text > Add Text.
A screenshot of Kutools Text menu with Add Text option highlighted and the Add Text dialog

4. In the opening Add Text dialog box, type the text you will replace with into the Text box, check the After last character option, and click the Ok button. See screenshot:

And then you will see the specified text replace all characters after the specific character (asterisk in our case). See screenshot:
A screenshot of modified text list in Excel after replacing text after specified character

Note: To replace all before the specified character, please select the second column of both split column in Step 3, and check the Before first character option in Step 4. See screenshot:
A screenshot of modified text list in Excel after replacing text before specified character

Kutools for Excel - Supercharge Excel with over 300 essential tools. Enjoy permanently free AI features! Get It Now


Demo: Replace all after/before specific characters of space in Excel

Kutools for Excel: Over 300 handy tools at your fingertips! Enjoy permanently free AI features! Download Now!

Related articles:

How to replace blank space with nothing/underscore/dash/comma 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  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  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 Toolsets12 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, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

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!