The LEFTB function returns the left portion of a string up to a certain number of bytes.

Parts of a LEFTB function

LEFTB(string, num_of_bytes)

PartDescription
stringThe string from which the left portion will be returned.
num_of_bytes(Optional) The number of bytes to return from the left side of string.

Notes

  • LEFTB returns the same value as LEFT if the input string has only single byte characters
  • num_of_bytes must be greater than or equal to zero.
  • If num_of_bytes is greater than the length of text in bytes, LEFTB returns all of text.
  • If num_of_bytes is omitted, it is assumed to be 1.

Examples

ABC
1InputFormula
2Aeñ=LEFTB(A2, 2)
3Aeñ=LEFT(A3,2)
4熊本=LEFTB(A4, 2)
5熊本=LEFT(A5,2)
  • MIDB: ​The MIDB function returns a section of a string starting at a given character and up to a specified number of bytes.
  • RIGHTB: The RIGHTB function returns the right portion of a string up to a certain number of bytes.
  • LENB: The LENB function returns the length of a string in bytes.