Google Sheets LEFTB Function

This post will guide you how to use Google Sheets LEFTB function with syntax and examples.

Description


The Google Sheets LEFTB function returns a substring (a specified number of the bytes) from a text string, starting from the left portion.

The LEFTB function can be used to extract the left portion of a string up to a certain number of bytes in google sheets.

The LEFTB function is a build-in function in Google Sheets and it is categorized as a Text Function.

Syntax


The syntax of the LEFTB function is as below:

= LEFTB (text,[num_of_bytes])

Where the LEFTB function arguments are:

  • Text -This is a required argument. The text string that you want to extract from.
  • num_of_bytes -This is an optional argument. It will specify the number of bytes that you want to extract from Text string.

Note: 

  • The num_of_bytes value must be greater than or equal to zero. If num_of_bytes value is greater that the length of text string, it will return all of text string. If num_of_bytes value is omitted, it is set to be 1 by default.
  • If NUM_of_bytes value equal to 0, it will cause LEFT function to extract the empty string.
  • If text string has only single bytes characters and the LEFTB function returns the same value as LEFT function.

Google Sheets LEFTB Function Examples


The below examples will show you how to use google sheets LEFTB Text function to extract the leftmost substring from a text string.

#1 To extract the leftmost 4 bytes in the B1 cell, just using formula:

=LEFTB(B1,4)

google sheets leftb function

#2 If you do not provide num_of_bytes argument, it will use the default value as 1, using the following formula:

=LEFTB(“google”)

google sheets leftb function

#3 If Num_chars exceeds the text string length, the LEFTB function will return the entire string:

=LEFTB("google",200)

google sheets leftb function

#4 If Text value is a numeric value, and the LEFTB function will return a text value:

=LEFTB(1234,2)

google sheets leftb function

Note:

You can use the LEFTB function to extract substring from the left side of a text string in Google Sheets. And you can also use another function called RIGHT function to extract a substring starting from the right side of the text string. And if you wish to extract a substring starting from the middle position of text string, you can use the MIDB function.

Related Functions


  • Google Sheets FIND Function
    The Google Sheets FIND function returns the position of the first text string (sub string) within another text string.The syntax of the FIND function is as below:= FIND(find_text, within_text,[start_num]) …

 

 

 

 

 

Related Posts

Google Sheets NETWORKDAYS Function
google sheets networkdays function1

This post will guide you how to use Google Sheets NETWORKDAYS function with syntax and examples. Description The Google Sheets NETWORKDAYS function returns the number of net working days between tow given days. The NETWORKDAYS function can be used to ...

Google Sheets MONTH Function
google sheets month function1

This post will guide you how to use Google Sheets MONTH function with syntax and examples. Description The Google Sheets MONTH function returns the month of a date represented by a serial number. And the month is an integer number ...

Google Sheets MINUTE Function
google sheets minute function1

This post will guide you how to use Google Sheets MINUTE function with syntax and examples. Description The Google Sheets MINUTE returns the minutes of a time value. And the minutes is an integer number from 0 to 59. So ...

Google Sheets ISOWEEKNUM Function
google sheets isoweeknum function1

This post will guide you how to use Google Sheets ISOWEEKNUM function with syntax and examples. Description The Google Sheets ISOWEEKNUM returns the number of the ISO week of the year for a given date. ISO weeks begin on Monday ...

Google Sheets HOUR Function
google sheets hour function1

This post will guide you how to use Google Sheets HOUR function with syntax and examples. Description The Google Sheets HOUR returns the hour of a time value. Or returns an integer value that represent the hour component of a ...

Google Sheets EOMONTH Function
google sheets eomonth function1

This post will guide you how to use Google Sheets EOMONTH function with syntax and examples. Description The Google Sheets EOMONTH returns a date representing the last day of the month, n months in the future or past. The EOMONTH ...

Google Sheets EDATE Function
google sheets edate function1

This post will guide you how to use Google Sheets EDATE function with syntax and examples. Description The Google Sheets EDATE returns a date that is a specified number of months before or after a specified date. You can use ...

Google Sheets DAYS360 Function
google sheets days360 function1

This post will guide you how to use Google Sheets DAYS360 function with syntax and examples. Description The Google Sheets DAYS360 will calculate the number of days between two dates based on a 360-day year. The DAYS360 function can be ...

Google Sheets DAYS Function
google sheets days function1

This post will guide you how to use Google Sheets DAYS function with syntax and examples. Description The Google Sheets DAYS  returns the number of days between two dates. The DAYS function can be used to get the number of ...

Google Sheets DAY Function
google sheets day function1

This post will guide you how to use Google Sheets DAY function with syntax and examples. Description The Google Sheets DAY returns a day of a date (from 1 to 31). You can use the DAY function to extract a ...

Sidebar