FormulaCraft

REPLACE

REPLACE substitutes a specified number of characters at a defined position in a string with new text, making it position-based rather than content-based. Use it when you know exactly where in a string a change needs to occur, such as updating a date code embedded at a fixed position in a product SKU.

Excel
=REPLACE(A2,1,3,"NEW")
Google Sheets
=REPLACE(A2,1,3,"NEW")

Verified example

Computed by a real spreadsheet engine on the sample data below.

ProductCode
OLDWGT001
OLDGDG002
OLDDOH003
OLDTHG004

=REPLACE(A2,1,3,"NEW")NEWWGT001

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

How it works

  1. 1Identify the starting position and the number of characters to replace within the original string.
  2. 2Decide the replacement text string (can be empty to effectively delete characters).
  3. 3Enter =REPLACE(old_text, start_num, num_chars, new_text) to get the modified string.

Need a version for your data?

Try: “Replace the first three characters of each product code with a new prefix

Related

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: