Text All versions ◉ 36 views

=SUBSTITUTE()

Substitutes new_text for old_text in a text string. Use SUBSTITUTE when you want to replace specific text in a text string; use REPLACE when you want to replace any text that occurs in a specific location in a text string.

Applies To: Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016
=SUBSTITUTE(text, old_text, new_text, [instance_num])
Hover argument names in the table for details.
Output typeText
Popularity60 / 100
VolatileNo
Dynamic ArrayNo
Download sample .xlsx ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =SUBSTITUTE() with Persian sample data & live formulas — open in Excel and practice.

  • Sheet “Sample” — data table + formula in place
  • Sheet “Guide” — syntax, arguments & tips from this page
  • Instant & secure (token + rate limit)
Download SUBSTITUTE.xlsx ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
text Any type Required The text or the reference to a cell containing text for which you want to substitute characters.
old_text Any type Required The text you want to replace.
new_text Any type Required The text you want to replace old_text with.
instance_num Any type Optional Specifies which occurrence of old_text you want to replace with new_text. If you specify instance_num, only that instance of old_text is replaced. Otherwise, every occurrence of old_text in text is changed to new_text.

▣ Examples

▦ Data
CellValue
A2 Sales Data
B2 <
A3 Quarter 1, 2008
B3 <
A4 Quarter 1, 2011
B4 <
A5 Sales Data
B5 <
A6 Quarter 1, 2008
B6 <
A7 Quarter 1, 2011
B7 <
Substitutes Cost for Sales (Cost Data) =SUBSTITUTE(A2, "Sales", "Cost")
Result: Cost Data
Substitutes first instance of "1" with "2" (Quarter 2, 2008) =SUBSTITUTE(A3, "1", "2", 1)
Result: Quarter 2, 2008
Substitutes third instance of "1" with "2" (Quarter 1, 2012) =SUBSTITUTE(A4, "1", "2", 3)
Result: Quarter 1, 2012

💬 Comments & Q&A 0 approved

🔒 Your comment will be published after review.

Share your thoughts — visible after admin approval

No comments yet — be the first!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.