[Table of Contents] [docx version]
SpreadsheetML Reference Material - Table of Contents
MIDB ( string , start-pos , number-bytes )
Description: Extracts number-bytes-worth of characters from string, starting at character position start-pos. (MIDB is intended for use with languages that use the double-byte character set (DBCS), whereas MID (§3.17.7.208) is intended for use with languages that use the single-byte character set (SBCS).)
Arguments:
Name |
Type |
Description |
string |
Designate the string from which a substring is to be extracted. | |
number-bytes |
number |
The number of characters to be extracted. number- bytes shall be at least 0. |
start-pos |
number |
The starting position within string, where the first byte is position 1. If start-pos is greater than the length of string, or if start-pos and number- bytes combined exceeds the length of string, the whole of string shall be extracted. |
Return Type and Value: text – A string containing number-bytes-worth of characters from string, starting at character position start-pos.
However, if
• start-pos < 0, #VALUE! is returned.
• number-bytes < 0, #VALUE! is returned.
[Example: Assuming 1-byte characters:
MIDB("abcdef",3,2) results in cd
MIDB(A10,4,1) results in 1, when A10 contains xyz123
MIDB("abcdef",4,5) results in def
end example]