Home  >  Article  >  Topics  >  How to use substitute function

How to use substitute function

(*-*)浩
(*-*)浩Original
2019-06-04 13:38:183860browse

Replace old_text with new_text in the text string. If you need to replace specified text in a text string, use the function SUBSTITUTE.

How to use substitute function

SUBSTITUTE is an Excel cell formula function, not an internal function of VBA. These two concepts must be clearly distinguished. Although there are many functions with the same name and similar usage, they are essentially different! The following is how the SUBSTITUTE function is used in Excel:

Syntax

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

Text is not omitted parameter. The text whose characters need to be replaced, or a reference to the cell containing the text.

Old_text does not omit parameters. is the old text that needs to be replaced.

New_text does not omit parameters, but has a default value of empty. Text to replace old_text.

Instance_num is a numerical value used to specify how many occurrences of old_text to replace with new_text. If instance_num is specified, only old_text that meets the requirements will be replaced; if it is defaulted, all occurrences of old_text in TEXT will be replaced with new_text.

Example

If A1=the revolution of learning, A2=computer

Then the formula=SUBSTITUTE(A1,"the revolution",A2,1 )

Return to "Learning Computers"

To view all available functions in Excel, you can click the "fx" icon on the left side of the Excel edit bar, which contains descriptions of all functions.

For more Excel-related technical articles, please visit the Excel Basic Tutorial column to learn!

The above is the detailed content of How to use substitute function. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn