Back to Functions

LEFTB

Returns the left portion of a string up to a certain number of bytes.

TextLEFTB(string, num_of_bytes)

The LEFTB function in Google Sheets returns the left portion of a string up to a certain number of bytes. It's especially useful when working with multi-byte character sets, where a single visible character can take up more than one byte. Dive into our comprehensive guide to master its application.

Parameters

  • string: The string you want to extract from.
  • num_of_bytes: The number of bytes to extract from the left side of the string.

Step-by-Step Tutorial

  1. Using LEFTB to extract a specific number of bytes from a string:
    • Example: =LEFTB("Google Sheets", 5)
    • Result: "Googl"

Use Cases and Scenarios

  1. Multilingual Text Extraction: Extract a specific number of bytes from strings containing multi-byte characters.
  2. Limited-Capacity Displays: Truncate text to fit a byte-limited field, such as a legacy database column.
  3. Byte-Level Data Manipulation: Perform byte-level operations when preparing data for export.

Related Functions

  • LEFT: Returns a substring from the beginning of a string, based on character count.
  • RIGHTB: Returns the right portion of a string up to a certain number of bytes.
  • MIDB: Returns a section of a string starting at a given byte, up to a specified number of bytes.

Related Articles

Newsletter

More LEFTB examples coming soon.

We are building short, practical updates for Sheets power users.