The MIDB function returns a section of a string starting at a given character and up to a specified number of bytes.

Parts of a MIDB function

MIDB(string, starting_at, extract_length_bytes)

PartDescription
stringThe string from which to extract a section.
starting_atThe position in the input string to start extracting from.
extract_length_bytesThe number of bytes the extracted string should have.

Notes

  • MIDB returns the same value as MID if the input string has only single byte characters
  • Starting_at must be greater than or equal to 1.
  • Extract_length_bytes must be greater than or equal to 0.

Examples

ABC
1InputFormula
2Aeñds=MIDB(A2, 2, 2)
3Aeñds=MID(A3, 2, 2)
4熊本=熊本=MIDB(A4,2,4)
5熊本=熊本=MID(A5,2,4)
  • LENB: The LENB function returns the length of a string in bytes.
  • LEFTB: The LEFTB function returns the left portion of a string up to a certain number of bytes.
  • RIGHTB: The RIGHTB function returns the right portion of a string up to a certain number of bytes.