# MIDB

## Content

This function returns the requested number of characters from a text string starting at the position you have specified (on the basis of the specified number of bytes).

## Syntax

`MIDB(text, start_num, num_bytes)`

## Arguments

This function has the following arguments:

| Argument | Description |
| -------- | ----------- |
| *text* | [Required] Refers to the text string containing the characters you want to extract. |
| *start\_num* | [Required] Refers to the number representing the first character you want to extract in text, with the first character in the text having a value of one (1). If this value is not an integer, the number is truncated. |
| *num\_bytes* | [Required] Refers to the number of characters to return from text (in bytes). If this value is not an integer, the number is truncated. |

The *text* argument can be a string or a formula that returns a string, or a reference to a cell containing that string.
The *start\_num* argument works on the following rule:

* If *start\_num* is greater than the length of *text* , this function returns "" (empty text).
* If *start\_num* is less than the length of *text* , but *start\_num* plus *num\_bytes* exceeds the length of *text* , this function returns the characters up to the end of text.

## Remarks

The MIDB function counts 2 bytes per character, but this happens only when a DBCS language is set as the default language.

## Examples

`MIDB("rosy garden", 6, 20)` gives the result garden.