FormulaCamp
Completed
← Google Sheets functions
Google Sheets function

REPLACE in Google Sheets

REPLACE with worked examples you can test in the live grid. The argument details are in the Excel guide.

In Google Sheets

The arguments and common errors are covered in the REPLACE Excel guide; check the function help in Google Sheets for its own argument list.

Worked examples in Google Sheets

Change a prefix

A
1Phone
2555-0100

Formula: C2: =REPLACE(A2,1,3,"800")

Result: 800-0100

The first three characters are replaced by 800.

Insert without deleting

A
1ID
2AB1234

Formula: C2: =REPLACE(A2,3,0,"-")

Result: AB-1234

With num_chars at 0 nothing is removed, so the hyphen is inserted before position 3.

Replace the last four characters

A
1Label
2Report 2024

Formula: C2: =REPLACE(A2,LEN(A2)-3,4,"2025")

Result: Report 2025

LEN(A2)-3 is the start of the year no matter how long the label is.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in D2: =REPLACE(A5,1,3,"ID")

Example spreadsheet for REPLACE
ABCD
1TextOtherResult
2Alice Johnsonalice johnsonID-2026-0415
3[email protected][email protected]
4 extra spaces
5SKU-2026-0415
6iced coffee, tea, sugar
7Order 417 shipped
Result in D2: ID-2026-0415
Practice this in a lesson: Find and Replace

Google Sheets is used here only as a descriptive product name. FormulaCamp is not affiliated with Google.