Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to use Replace function to replace and add string in Excel?

Author Sun Last modified

In Excel, we may use the Find and Replace function to find a string then replace with another one. But in many cases, the Find and Replace function cannot satisfy your request. Here I introduce how to use the Replace function to solve some problems in Excel.

Replace function


Replace function

=REPLACE(text, start_num, num_chars, new_text)

Case 1 Replace character string in the specific location with other in a string

=REPLACE(text, startnum, numchars, newtext)

If you want to replace a character string in a specific location with another string as below screenshot shown,
Replace character string in the specific location

you can do as this:

Select a cell which you will place the result and type=REPLACE(A1,3,3,"KTE"), and drag fill handle over the cells you use. See screenshot shown.
use a formual to replace characters in the specific location

a screenshot of kutools for excel ai

Unlock Excel Magic with Kutools AI

  • Smart Execution: Perform cell operations, analyze data, and create charts—all driven by simple commands.
  • Custom Formulas: Generate tailored formulas to streamline your workflows.
  • VBA Coding: Write and implement VBA code effortlessly.
  • Formula Interpretation: Understand complex formulas with ease.
  • Text Translation: Break language barriers within your spreadsheets.
Enhance your Excel capabilities with AI-powered tools. Download Now and experience efficiency like never before!

Case 2 Replace multiple character strings in multiple locations with others in a string

=REPLACE(REPLACE(text,stratnum,characternumber,"newtext"),startnum,characternumber,"newtext)

If you want to replace multiple character strings in locations with other strings as below screenshot shown,
Replace multiple character strings in multiple locations

Do as this:

Select a cell which you will place the result and type =REPLACE(REPLACE(A7,7,1,"1"),15,1,"3"), drag fill handle over the cells you use. See screenshot shown.
enter a formula to replace multiple characters in multiple locations

Case 3 Replace year/mont/day in Date format

=REPLACE(TEXT(text, "dd-mmm-yy"), 4, 3, "newtext")

If you have a range of cells in the special date format 1-Oct-18, what you need is to replace the month to Nov as below screenshot shown,
Replace year/mont/day in Date format

Use this formula

Select a cell which you will place the result and type =REPLACE(TEXT(A14, "dd-mmm-yy"), 4, 3, "Nov"), drag fill handle over the cells you use. See screenshot shown.
use a formula to replace year/mont/day in Date format

Case 4 Convert number to date

=DATEVALUE(REPLACE(REPLACE(text,3,0,"/"),6,0,"/"))

If you want to convert text number to standard dates as below screenshot shown, do as this:
Convert number to date

Select a cell which you will place the result and type =DATEVALUE(REPLACE(REPLACE(A21,3,0,"/"),6,0,"/")), drag fill handle over the cells you use, the format the cells as Short Date format. See screenshot shown.
enter a formula
format the numbers to dates

Case 5 Replace character string with other in the string

=REPLACE(textreference, FIND("oldtext",textreference), numbercharacter, "newtext")

If you want to replace a string with another in the string as below screenshot shown,
Replace character string with other

Just use the Replace function and Find function

Select a cell which you place the result and type =REPLACE(A28, FIND("@abc",A28), 4, "@bca"), drag fill handle over the cells you use. See screenshot shown.
apply a formual to replace character string with other

Tip: This formula only work for the first occurrence of string.
This formula only work for the first occurrence of string

Case 6 Add new character into specific location of the string

=REPLACE(REPLACE(text,startnumber,0,"newtext"),startnumber,0,"newtext")

If you want to add new character into specific locations of a string as below screenshot shown.
 Add new character into specific location

Just do as this

Select a cell which you will place the result and type =REPLACE(REPLACE(A34,4,0,"-"),8,0,"-"), drag fill handle over the cells you use. See screenshot shown.
apply a formula to add new character into specific location

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!

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.

Excel Word Outlook Tabs PowerPoint
  • 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