Difference between revisions of "Manuals/calci/SUBSTITUTE"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left"> <font color="#484848"><font face="Arial, sans-serif"><font size="2">'''SUBSTITUTE'''</font></font></font><font color=...")
 
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
<div style="font-size:30px">'''SUBSTITUTE (Text,OldText,NewText,InstanceNumber) '''</div><br/>
 +
 +
where
 +
*<math>Text</math> is the text or reference to cell containing text, from which certain string is to be substituted,
 +
*<math>OldText</math> is the old text to be replaced,
 +
*<math>NewText</math> is the new text that replaces the characters in old text,
 +
*<math>InstanceNumber</math> is the instance number that specifies which occurrence needs to be replaced.
 +
**SUBSTITUTE(), substitutes specific instances of old text with new text in a text string.
 +
 +
 +
== Description ==
 +
SUBSTITUTE (Text,OldText,NewText,InstanceNumber)
 +
For Example,
 +
SUBSTITUTE("WELCOME", "COME", "DONE", 1) returns ''WELDONE''
 +
In above example, first instance of old text is replaced with new text.
 +
*SUBSTITUTE function can be used to replace specific occurrences of the text.
 +
*If <math>Text</math> is entered directly as a part of argument, it should be enclosed in quotation marks (e.g. "TEXT").
 +
*<math>OldText</math> and <math>NewText</math> should be enclosed in quotation marks (e.g. "TEXT").
 +
*If string specified in <math>OldText</math> is not part of the reference string <math>Text</math>, Calci returns the original string <math>Text</math> as a result.
 +
*Argument <math>InstanceNumber</math> is optional. If omitted, all instances mentioned in old text are replaced by new text.
 +
*<math>InstanceNumber</math> should be an integer &gt; 0, else Calci displays #NULL error message.
 +
 +
== Examples ==
 +
 
<div id="6SpaceContent" class="zcontent" align="left">
 
<div id="6SpaceContent" class="zcontent" align="left">
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''SUBSTITUTE'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">(</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''txt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''od_txt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''nw_txt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">,inst_n)</font></font></font>
+
{| id="TABLE3" class="SpreadSheet blue"
 +
|- class="even"
 +
| class="ssh1_f" |SUBSTITUTE
 +
| class=" " |
 +
| class=" " |
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">''''''</font></font></font>
+
|- class="odd"
 +
| class="ssh1_f" |abc123abc123
 +
| class="  " |
 +
| class=" " |
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''where txt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the text that want to substitute characters and o</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">'''d_txt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the text that want to replace and</font></font></font>
+
|- class="even"
 +
| class="ssh1_f" |Cost Price
 +
| class=" " |
 +
| class=" " |
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''nw_txt'''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">   is the text that want to replace od_txt with and</font></font></font>
+
|}
 
 
<font color="#484848"><font face="Arial, sans-serif"><font size="2">'''inst_n is the '''</font></font></font><font color="#484848"><font face="Arial, sans-serif"><font size="2">occurrence of od_txt that want to replace with nw_txt. </font></font></font>
 
  
</div>
+
=SUBSTITUTE(A1,"TUTE", "TUTION",1) : Replaces first instance of old text with new text. <br />Returns '''SUBSTITUTION''' as output.
----
+
=SUBSTITUTE(A2,"123","888",2) :Replaces second instance of old text with new text. <br />Returns '''abc123abc888''' as output.
<div id="1SpaceContent" class="zcontent" align="left">
+
=SUBSTITUTE(A2,"123","888") : Replaces all instances of old text with new text. <br />Returns '''abc888abc888''' as output.
 +
=SUBSTITUTE(A3,"Cost", "Selling") : Returns '''Selling Price''' as output.
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">It replaces new text for old text in a text string. </font></font></font>
+
==Related Videos==
  
</div>
+
{{#ev:youtube|YvHrFS-sfiU|280|center|SUBSTITUTE}}
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
  
SUBSTITUTE
+
== See Also ==
  
</div></div>
+
*[[Manuals/calci/REPLACE | REPLACE]]
----
+
*[[Manuals/calci/REPT | REPT]]
<div id="8SpaceContent" class="zcontent" align="left"> <font color="#484848"><font face="Arial, sans-serif"><font size="2">Let’s see an example in (Column1 Row 1)</font></font></font>
 
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">C1R1 = Cost Price</font></font></font>
+
==References==
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">I.e.=SUBSTITUTE(C1R1,”Cost”,”Selling”) is</font></font></font>
+
*[http://en.wikipedia.org/wiki/Autocorrection Find and Replace]
 +
*[http://en.wikipedia.org/wiki/String_operations#String_substitution String Substitution]
  
<font color="#484848"><font face="Arial, sans-serif"><font size="2">Selling Price</font></font></font>
 
  
</div>
 
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Examples </div></div>
 
----
 
<div id="11SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Description </div></div>
 
----
 
<div id="2SpaceContent" class="zcontent" align="left">
 
  
{| id="TABLE3" class="SpreadSheet blue"
+
*[[Z_API_Functions | List of Main Z Functions]]
|- class="even"
 
| class=" " |
 
| Column1
 
| class="  " | Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class=" " | Cost Price
 
| class="sshl_f" | Selling Price
 
|
 
| class="                                                            sshl_f  " |
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f  " |
 
<div id="2Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
| class="  SelectTD SelectTD" |
 
<div id="2Space_Handle" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="2Space_Copy" title="Click and Drag over to AutoFill other cells."></div>
 
|
 
|
 
|- class="odd"
 
| Row3
 
| class="                                      sshl_f        " |
 
|
 
|
 
|
 
|- class="even"
 
| Row4
 
|
 
|
 
|
 
| class="  " |
 
|- class="odd"
 
| class=" " | Row5
 
|
 
|
 
|
 
|
 
|- class="even"
 
| Row6
 
|
 
|
 
|
 
|
 
|}
 
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
*[[ Z3 |  Z3 home ]]
----
 

Latest revision as of 17:01, 13 August 2018

SUBSTITUTE (Text,OldText,NewText,InstanceNumber)


where

  • is the text or reference to cell containing text, from which certain string is to be substituted,
  • is the old text to be replaced,
  • is the new text that replaces the characters in old text,
  • is the instance number that specifies which occurrence needs to be replaced.
    • SUBSTITUTE(), substitutes specific instances of old text with new text in a text string.


Description

SUBSTITUTE (Text,OldText,NewText,InstanceNumber) For Example, SUBSTITUTE("WELCOME", "COME", "DONE", 1) returns WELDONE In above example, first instance of old text is replaced with new text.

  • SUBSTITUTE function can be used to replace specific occurrences of the text.
  • If is entered directly as a part of argument, it should be enclosed in quotation marks (e.g. "TEXT").
  • and should be enclosed in quotation marks (e.g. "TEXT").
  • If string specified in is not part of the reference string , Calci returns the original string as a result.
  • Argument is optional. If omitted, all instances mentioned in old text are replaced by new text.
  • should be an integer > 0, else Calci displays #NULL error message.

Examples

SUBSTITUTE
abc123abc123
Cost Price
=SUBSTITUTE(A1,"TUTE", "TUTION",1) : Replaces first instance of old text with new text. 
Returns SUBSTITUTION as output. =SUBSTITUTE(A2,"123","888",2) :Replaces second instance of old text with new text.
Returns abc123abc888 as output. =SUBSTITUTE(A2,"123","888") : Replaces all instances of old text with new text.
Returns abc888abc888 as output. =SUBSTITUTE(A3,"Cost", "Selling") : Returns Selling Price as output.

Related Videos

SUBSTITUTE

See Also

References