Returns a specific number of characters in a text string starting at the specified position, specified by the user. This function works with double-byte characters.
Syntax
MIDB(text,start_num,num_bytes)
Text is a text string containing the characters to be extracted.
Start_num is the first element to be extracted from the text character position. The first character in the text has start_num equal to 1, and so on.
Num_bytes specifies the characters you want MIDB to return from the text The number (in bytes).
Description
If num_bytes is a negative number, MIDB returns the error value #VALUE!.
MIDB function is a Text function, generally used to intercept characters in a string. Its function can extract the specified character from the specified position in the specified string
number of characters.
Let me tell you the specific steps to use this function.
Take this table as an example, assuming we want to intercept mobile phone number information.
![微信图片_20190529164623.png 微信图片_20190529164623.png](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/c31edda9a2d406b9760ca0ec1185ccd6.png)
![图文对齐图.png 图文对齐图.png](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/e1ea7da86ff61befb1c583b6784f105d.png)
■ Select cell B2, click Insert Function, find and select the MIDB function in the search box, and click OK.
Here, we need to fill in three parameters.
String: the text from which characters need to be extracted
Starting position: the starting position of the string to be extracted
Number of bytes: the length of the string to be extracted
It should be noted that 1 Chinese character is equal to 2 bytes, while 1 English letter or number is 1 byte.
![GIF1.gif GIF1.gif](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/abe7035fdb254c17b249cb6da7f08260.gif)
■ We fill in A2 in the string.
Because "Wang Xiaoming" is a Chinese character and 1 character is equivalent to 2 bytes, 7 is filled in at the beginning.
Enter 11 for the number of bytes.
Click OK and you can see that the mobile phone number has been extracted.
Position the cursor to the lower right corner of cell B2, and when the + glyph appears, pull down to fill the cell to extract data in batches.
![GIF2.gif GIF2.gif](https://font2020.oss-cn-beijing.aliyuncs.com/wps/images/69ba32af38e9224f9f244d10c4f774e2.gif)
评论列表(196条)
测试