# SUBSTITUTE

Spread for WinForms provides advanced software components that support Excel import/export, full cell customization, an extensive calculation engine with over 450 functions and more, all with zero dependencies on Excel.

## Content



This function substitutes a new string for specified characters in an existing string.

## Syntax

SUBSTITUTE(*text*,*old\_piece*,*new\_piece*,*instance*)

## Arguments

This function has these arguments:

| **Argument** | **Description** |
| -------- | ----------- |
| *text* | String or reference to a cell containing the string in which you want to replace characters |
| *old\_piece* | String to be replaced |
| *new\_piece* | New string to use instead of existing string |
| *instance* | [Optional] Which occurrence of the existing string to replace; otherwise every occurrence is replaced |

## Remarks

Use this function to replace specific text with other text. Use the [REPLACE](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionREPLACE) function to replace a specific number of characters in a specific location with other characters.

## Data Types

Accepts string data for the *text*, *old\_piece*, and *new\_piece* arguments, and numeric data for the *instance* argument. Returns string data.

## Examples

`SUBSTITUTE("Down Trend","Down","Up")` gives the result Up Trend
`SUBSTITUTE("Feb 1, 1991","1","2", 3)` gives the result Feb 1, 1992

## Version Available

This function is available in product version 1.0 or later.

## See Also

[FIND](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsDtoG/FunctionFIND) \| [REPLACE](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsRtoS/FunctionREPLACE) \| [TRIM](/spreadnet/docs/latest/online-formula/formulas-functionsall/formulas-functsTtoZ/FunctionTRIM) \| [Text Functions](/spreadnet/docs/latest/online-formula/formulas-overview/formulas-functs/formulas-functtypes/formulas-functstext)