Difference between revisions of "Manuals/calci/MID"
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">'''MID'''</font></font></font><font color="#48484...") |
|||
Line 1: | Line 1: | ||
− | + | =MID(txt, snum, noc)= | |
− | + | where, | |
+ | *<math>txt</math> is a text string containing the characters to be extracted, | ||
+ | *<math>snum</math> is the starting position of the first character to be extracted, and | ||
+ | *<math>noc</math> represents the number of characters to be displayed. | ||
− | + | MID() displays a specific number of characters from a text string, with reference to the specified starting position and specified number of characters. | |
− | + | == Description == | |
− | |||
− | |||
− | + | MID(txt, snum, noc) | |
− | + | e.g. MID("String",1,3) displays '''Str''' as a result. | |
− | < | + | *MID counts 1 byte per characters. MID works with the languages that use 'Single Byte Character Set' (SBCS). |
+ | *If argument <math>txt</math> is directly entered in the command, it should be enclosed in double quotes (e.g. "Name"). | ||
+ | *<math>snum</math> should be >= 1, else Calci displays #N/A error message. | ||
+ | *If <math>snum</math> > 'length of text', Calci displays empty text (""). | ||
+ | *If <math>snum</math> + <math>noc</math> > 'length of text', Calci displays the characters up to the end of text. | ||
+ | *If <math>noc</math> is negative, Calci displays #N/A error message. | ||
− | + | == Examples == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<div id="2SpaceContent" class="zcontent" align="left"> | <div id="2SpaceContent" class="zcontent" align="left"> | ||
{| id="TABLE3" class="SpreadSheet blue" | {| id="TABLE3" class="SpreadSheet blue" | ||
|- class="even" | |- class="even" | ||
+ | | class="sshl_f" |WelCome | ||
| class=" " | | | class=" " | | ||
− | + | | class=" " | | |
− | | class=" | + | |
− | |||
− | |||
|- class="odd" | |- class="odd" | ||
− | | class=" " | | + | | class="sshl_f" |Apple Orange |
− | | class=" " | | + | | class=" " | |
− | | class=" | + | | class=" " | |
− | + | ||
− | |||
|- class="even" | |- class="even" | ||
− | | class=" | + | | class="sshl_f" |*123*123 |
− | | class=" | + | | class=" " | |
− | | | + | | class=" " | |
− | | class=" | + | |
− | |||
− | |||
|- class="odd" | |- class="odd" | ||
− | + | | class="sshl_f" | | |
− | | class=" | + | | class=" " | |
− | + | | class=" " | | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | | | ||
|} | |} | ||
− | + | =MID(A1,1,3) : Displays 3 character string in cell A1 starting from 5th position. Displays '''Wel''' as the output. | |
− | + | =MID(A2,7,14) : Displays 14 characters in cell A2 starting from 7th position. Displays '''Orange''' as the output. | |
+ | =MID(A3,1,1) : Displays character string in cell A3 starting from 1st position. Displays '''*''' as the output. | ||
+ | =MID("good" & "morning",1,8) : Joins the two strings and returns 8 characters starting from 1st position. Displays '''goodmorn''' as the output. | ||
+ | |||
+ | == See Also == | ||
+ | |||
+ | *[[Manuals/calci/MIDB | MIDB]] | ||
+ | |||
+ | == References == | ||
+ | |||
+ | *[http://en.wikipedia.org/wiki/String_(computer_science) String] |
Revision as of 17:21, 25 January 2014
MID(txt, snum, noc)
where,
- is a text string containing the characters to be extracted,
- is the starting position of the first character to be extracted, and
- represents the number of characters to be displayed.
MID() displays a specific number of characters from a text string, with reference to the specified starting position and specified number of characters.
Description
MID(txt, snum, noc)
e.g. MID("String",1,3) displays Str as a result.
- MID counts 1 byte per characters. MID works with the languages that use 'Single Byte Character Set' (SBCS).
- If argument is directly entered in the command, it should be enclosed in double quotes (e.g. "Name").
- should be >= 1, else Calci displays #N/A error message.
- If > 'length of text', Calci displays empty text ("").
- If + > 'length of text', Calci displays the characters up to the end of text.
- If is negative, Calci displays #N/A error message.
Examples
WelCome | ||
Apple Orange | ||
*123*123 | ||
=MID(A1,1,3) : Displays 3 character string in cell A1 starting from 5th position. Displays Wel as the output. =MID(A2,7,14) : Displays 14 characters in cell A2 starting from 7th position. Displays Orange as the output. =MID(A3,1,1) : Displays character string in cell A3 starting from 1st position. Displays * as the output. =MID("good" & "morning",1,8) : Joins the two strings and returns 8 characters starting from 1st position. Displays goodmorn as the output.