---
title: "SUBSTITUTE function in Excel: syntax and examples | PracticeExcel"
description: "How to use SUBSTITUTE in Excel and Google Sheets: replace or remove characters in text."
canonical_url: "https://practiceexcelonline.com/functions/substitute"
locale: en
meta:
  "og:description": "How to use SUBSTITUTE in Excel and Google Sheets: replace or remove characters in text."
  "og:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~U1VCU1RJVFVURSBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBTVUJTVElUVVRFIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByZXBsYWNlIG9yIHJlbW92ZSBjaGFyYWN0ZXJzIGluIHRleHQu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VCU1RJVFVURSh0ZXh0LCBvbGRfdGV4dCwgbmV3X3RleHQsIFtpbnN0YW5jZV9udW1dKQ%2Cp_Ii9mdW5jdGlvbnMvc3Vic3RpdHV0ZSI%2Cs_TvV2Pvhr_f85K-V9.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "SUBSTITUTE function in Excel: syntax and examples | PracticeExcel"
  "twitter:image": "https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~U1VCU1RJVFVURSBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBTVUJTVElUVVRFIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByZXBsYWNlIG9yIHJlbW92ZSBjaGFyYWN0ZXJzIGluIHRleHQu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VCU1RJVFVURSh0ZXh0LCBvbGRfdGV4dCwgbmV3X3RleHQsIFtpbnN0YW5jZV9udW1dKQ%2Cp_Ii9mdW5jdGlvbnMvc3Vic3RpdHV0ZSI%2Cs_TvV2Pvhr_f85K-V9.png"
---

> Index of every page on this site: [llms.txt](https://practiceexcelonline.com/llms.txt)

# **The SUBSTITUTE function**

Replaces existing text with new text, everywhere or only the n-th time it appears.

=

SUBSTITUTE(

## **Syntax**

```
SUBSTITUTE(text, old_text, new_text, [instance_num])
```

<dl><dt>**text **</dt>
<dd>The text to change.</dd>
<dt>**old_text **</dt>
<dd>The text to replace.</dd>
<dt>**new_text **</dt>
<dd>The replacement. "" removes old_text.</dd>
<dt>**instance_num **(optional)</dt>
<dd>Which occurrence to replace. Left out, every one is replaced.</dd></dl>

## **Examples**

C1`=SUBSTITUTE(<sup>1</sup>A2,<sup>2</sup>"-",<sup>3</sup>"")`

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Code |  | **DK2100** |
| 2 | DK-2100 |  | |

**In plain words:** In <sup>1</sup>the code in A2, replace <sup>2</sup>every dash with <sup>3</sup>nothing.

C1=SUBSTITUTE("a-b-c","-","/",2)

|  | A | B | C |
| --- | --- | --- | --- |
| 1 | Code |  | **a-b/c** |
| 2 | DK-2100 |  | |

## **Practice SUBSTITUTE**

- [**1****Count the words in a cell**→](https://practiceexcelonline.com/practice/find-search/count-words-in-cell)

## **Read the guide**

- [**How to clean data in Excel with formulas**](https://practiceexcelonline.com/learn/clean-data-in-excel)

## **Related functions**

- [**TRIM**](https://practiceexcelonline.com/functions/trim)
- [**FIND**](https://practiceexcelonline.com/functions/find)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://practiceexcelonline.com/#identity","@type":"Organization","name":"PracticeExcel","url":"https://practiceexcelonline.com/","logo":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/#website","@type":"WebSite","inLanguage":"en-US","name":"PracticeExcel","url":"https://practiceexcelonline.com/","alternateName":["Practice Excel Online","PracticeExcelOnline.com"],"publisher":{"@id":"https://practiceexcelonline.com/#identity"},"workTranslation":{"@id":"https://excelopgaver.dk/#website"}},{"@id":"https://practiceexcelonline.com/functions/substitute#webpage","@type":"WebPage","description":"How to use SUBSTITUTE in Excel and Google Sheets: replace or remove characters in text.","name":"SUBSTITUTE function in Excel: syntax and examples","url":"https://practiceexcelonline.com/functions/substitute","breadcrumb":{"@id":"https://practiceexcelonline.com/functions/substitute#breadcrumb"},"isPartOf":{"@id":"https://practiceexcelonline.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://practiceexcelonline.com/functions/substitute"]}],"primaryImageOfPage":{"@id":"https://practiceexcelonline.com/#logo"}},{"@id":"https://practiceexcelonline.com/functions/substitute#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Home","item":"https://practiceexcelonline.com","position":1},{"@type":"ListItem","name":"Excel functions","item":"https://practiceexcelonline.com/functions","position":2},{"@type":"ListItem","name":"SUBSTITUTE function in Excel: syntax and examples","position":3}]},{"@id":"https://practiceexcelonline.com/functions/substitute#article","description":"How to use SUBSTITUTE in Excel and Google Sheets: replace or remove characters in text.","headline":"SUBSTITUTE function in Excel: syntax and examples","inLanguage":"en-US","thumbnailUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~U1VCU1RJVFVURSBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBTVUJTVElUVVRFIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByZXBsYWNlIG9yIHJlbW92ZSBjaGFyYWN0ZXJzIGluIHRleHQu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VCU1RJVFVURSh0ZXh0LCBvbGRfdGV4dCwgbmV3X3RleHQsIFtpbnN0YW5jZV9udW1dKQ%2Cp_Ii9mdW5jdGlvbnMvc3Vic3RpdHV0ZSI%2Cs_TvV2Pvhr_f85K-V9.png","@type":["Article","TechArticle"],"author":{"@id":"https://practiceexcelonline.com/#identity"},"image":{"@id":"https://practiceexcelonline.com/#/schema/image/1"},"isPartOf":{"@id":"https://practiceexcelonline.com/functions/substitute#webpage"},"mainEntityOfPage":{"@id":"https://practiceexcelonline.com/functions/substitute#webpage"},"publisher":{"@id":"https://practiceexcelonline.com/#identity"}},{"@id":"https://practiceexcelonline.com/#logo","@type":"ImageObject","caption":"PracticeExcel","contentUrl":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/brand/practiceexcel/icon-512.png"},{"@id":"https://practiceexcelonline.com/#/schema/image/1","@type":"ImageObject","contentUrl":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~U1VCU1RJVFVURSBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBTVUJTVElUVVRFIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByZXBsYWNlIG9yIHJlbW92ZSBjaGFyYWN0ZXJzIGluIHRleHQu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VCU1RJVFVURSh0ZXh0LCBvbGRfdGV4dCwgbmV3X3RleHQsIFtpbnN0YW5jZV9udW1dKQ%2Cp_Ii9mdW5jdGlvbnMvc3Vic3RpdHV0ZSI%2Cs_TvV2Pvhr_f85K-V9.png","inLanguage":"en-US","url":"https://practiceexcelonline.com/_og/d/c_Page%2Ctitle_~U1VCU1RJVFVURSBmdW5jdGlvbiBpbiBFeGNlbDogc3ludGF4IGFuZCBleGFtcGxlcw%2Cdescription_~SG93IHRvIHVzZSBTVUJTVElUVVRFIGluIEV4Y2VsIGFuZCBHb29nbGUgU2hlZXRzOiByZXBsYWNlIG9yIHJlbW92ZSBjaGFyYWN0ZXJzIGluIHRleHQu%2Ceyebrow_Excel%2Bfunctions%2Csite_practiceexcel%2Ccode_~U1VCU1RJVFVURSh0ZXh0LCBvbGRfdGV4dCwgbmV3X3RleHQsIFtpbnN0YW5jZV9udW1dKQ%2Cp_Ii9mdW5jdGlvbnMvc3Vic3RpdHV0ZSI%2Cs_TvV2Pvhr_f85K-V9.png"}]}
```

## Sitemap

See the full [sitemap](https://practiceexcelonline.com/sitemap.md) for all pages.
