# Google Sheets LEFTB Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/leftb-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The LEFTB function extracts a specified number of bytes from the beginning of a text string, useful for handling multi-byte characters.

```
LEFTB(string, num_of_bytes)
```

Generate FormulaExplain Formula

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Describe the LEFTB you need in plain EnglishGenerate Formula

## Parameters

**`string`**:\
The text string from which you want to extract the leftmost characters based on the specified number of bytes.

**`num_of_bytes`**:\
The number of bytes to extract from the left side of the `string`. This determines how many characters will be returned, with each character potentially counting as one or more bytes depending on the character encoding.

## What is a LEFTB Google Sheets Formula?

The *LEFTB* function in Google Sheets is a text function that allows you to extract a specified number of bytes from the beginning of a text string. This function is particularly useful when dealing with multi-byte character sets, such as those used in languages like Chinese, Japanese, and Korean. Unlike the *LEFT* function, which counts characters, *LEFTB* counts bytes, making it more suitable for certain applications.

In simpler terms, *LEFTB* lets you pull out a specific number of bytes from the start of a text string, which can be essential for handling text in different languages or when working with binary data.

## A Practical Example

Imagine you are working with a dataset that includes product codes, and you need to extract the first few bytes for analysis:

### Product Codes Table:

| ProductCode |
| - |
| ABC123 |
| 你好123 |
| XYZ456 |

You want to extract the first 4 bytes from each product code.

## LEFTB Formula

To achieve this, you would use the *LEFTB* function as follows:

```
=LEFTB(A2, 4)
```

In this formula:

- `A2` is the cell containing the ProductCode from the Product Codes Table.
- `4` is the number of bytes you want to extract from the beginning of the text string.

## Result of the Formula

When you apply the *LEFTB* formula to the Product Codes Table, the output would look like this:

| ProductCode | Extracted Bytes |
| - | - |
| ABC123 | ABC1 |
| 你好123 | 你好 |
| XYZ456 | XYZ4 |

In this case, the *LEFTB* function extracts the first 4 bytes from each product code, which is particularly useful for the multi-byte characters in the second row.

## Why Use LEFTB?

*LEFTB* is beneficial because it provides a way to accurately handle text strings that contain multi-byte characters. This function simplifies the process of extracting specific portions of text without worrying about character count, making it ideal for data manipulation in various languages.

## Key Takeaways:

- **LEFTB**: A Google Sheets function that extracts a specified number of bytes from the beginning of a text string.
- **Byte Count**: Counts bytes instead of characters, making it suitable for multi-byte character sets.
- **Data Handling**: Useful for text manipulation in different languages and binary data processing.
- **Common Use Cases**: Ideal for extracting portions of product codes, handling international text, and working with byte-level data.

*LEFTB* is an essential function for anyone working with text data in Google Sheets, providing a powerful way to enhance data analysis and processing capabilities.

Happy spreadsheeting!

## Example use case

You have a table where Column A contains product codes and Column B contains descriptions. You can use the LEFTB formula to extract the first few characters of each product code in Column C, allowing for quick categorization and analysis of product types.

## Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Subtract In Google Sheets](https://betteranalyst.com/google-sheets/how-to-subtract-in-google-sheets)
- [How To Transpose Data In Google Sheets](https://betteranalyst.com/google-sheets/how-to-transpose-data-in-google-sheets)
- [How To Unhide Columns In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-columns-in-google-sheets)
- [How To Unhide Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-rows-in-google-sheets)
- [How To Unprotect Google Sheets](https://betteranalyst.com/google-sheets/how-to-unprotect-google-sheets)
- [How To Wrap Text In Google Sheets](https://betteranalyst.com/google-sheets/how-to-wrap-text-in-google-sheets)
- [Google Sheets Conditional Formatting](https://betteranalyst.com/google-sheets/google-sheets-conditional-formatting)
- [How To Add A Column In Google Sheets](https://betteranalyst.com/google-sheets/how-to-add-a-column-in-google-sheets)

## Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

## Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

1. [01ChatGPTOpen a balanced comparison prompt in ChatGPT.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.
