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
- Using
LEFTBto extract a specific number of bytes from a string:- Example:
=LEFTB("Google Sheets", 5) - Result:
"Googl"
- Example:
Use Cases and Scenarios
- Multilingual Text Extraction: Extract a specific number of bytes from strings containing multi-byte characters.
- Limited-Capacity Displays: Truncate text to fit a byte-limited field, such as a legacy database column.
- 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.