The MIDB function returns a specific number of characters from a text string, starting at the position you specify, based on the number of bytes you specify.

MIDB takes 3 required arguments and no optional arguments:

Syntax: MIDB(text, start_num, num_bytes)

#1)
Using the MIDB function:
#2)
The arguments for the MIDB function are:
Argument Required? Description
text Required The text string containing the characters you want to extract.
start_num Required The position of the first character you want to extract in text. The first character in text has start_num 1, and so on.
num_bytes Required Specifies the number of characters you want MIDB to return from text, in bytes.
#3)
A few more things:
If start_num is greater than the length of bytes, MIDB returns "" (empty text).
If start_num is less than the length of bytes, but start_num plus num_bytes exceeds the length of bytes, MIDB returns the characters up to the end of text.
If start_num is less than 1, MIDB returns the #VALUE! error value.
If num_bytes is negative, MIDB returns the #VALUE! error value.

Summary

The MIDB function returns a specific number of characters from a text string, starting at the position you specify, based on the number of bytes you specify.
comments powered by Disqus