Google Sheets LENB Function

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

Description


The Google Sheets LENB function returns the length of a text string in bytes.

The LENB function can be used to count the number of bytes of a given text string including space or nonprint characters in google sheets. If a text string is a double byte character set, for example, Japanese, Chinese and Korean, each character should be counted as 2 bytes.

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

Syntax


The syntax of the LENB function is as below:

= LENB (text)

Where the LENB function arguments are:

  • Text -This is a required argument. The text string that you want to get the length of.

Note: 

  • The LENB function only takes one argument. It counts the number of bytes in text string, including space or non-printing characters. If the LENB function returns unexpected values, and you need to make sure that there are no such characters in given text string.
  • If text string is an empty string or cell reference to an empty cell, the LENB function returns
  • LENB function will also count the characters in numeric value. 

Google Sheets LENB Function Examples


The below examples will show you how to use google sheets LENB Text function to get the length of a text string in bytes.

#1 To get the number of bytes in the B1 cell, just using formula: 

=LENB(B1)

google sheets lenb function1

#2 To get the Length of the text string in B2 Cell, just using formula:

=LENB(B2)

google sheets lenb function1

#3 Using LENB function to count the number of bytes in a text string:

=LENB(“google”)   //it returns 6

google sheets lenb function1

#4 count the number of bytes in a text string in which contain a space character:

=LENB(“google      “)  //it returns 9

google sheets lenb function1

The LENB function can be used with the LEFT function and FIND function to extract a substring text to the left of a given text string .

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]) …
  • Google Sheets LEFT Function
    returns a substring (a specified number of the characters) from a text string, starting from the leftmost character. The syntax of the LEFT function is as below:= LEFT(text,[num_chars]) …

 

 

 

 

 

 

 

 

 

Related Posts

Google Sheets DEGREES Function
google sheets degrees function1

This post will guide you how to use Google Sheets DEGREES function with syntax and examples. Description The Google Sheets DEGREES function converts radians into degrees. And it will return a numeric value. For examples, if you pass the PI() function into ...

Google Sheets COSH Function
google sheets cosh function1

This post will guide you how to use Google Sheets COSH function with syntax and examples. Description The Google Sheets COSH function returns the hyperbolic cosine of a given angle. The purpose of this function is used to get hyperbolic ...

Google Sheets COS Function
google sheets cos function1

This post will guide you how to use Google Sheets COS function with syntax and examples. Description The Google Sheets COS function returns the cosine of a given angle. If you want to supply an angle to COS function in ...

Google Sheets COMBINA Function
google sheets combina function1

This post will guide you how to use Google Sheets COMBINA function with syntax and examples. Description The Google Sheets COMBINA function returns the number of combinations for a given number of items and it includes repetitions. You can use ...

Google Sheets COMBIN Function
google sheets combin function1

This post will guide you how to use Google Sheets COMBIN function with syntax and examples. Description The Google Sheets COMBIN function returns the number of combinations for a given number of items. And you can use the COMBIN function ...

Google Sheets CEILING.PRECISE Function
google sheets ceiling.precise function1

This post will guide you how to use Google Sheets CEILING.PRECISE function with syntax and examples. Description The Google Sheets CEILING.PRECISE function returns a given number rounded up to the nearest multiple of a given number of significance or returns ...

Google Sheets CEILING Function
google sheets ceiling function1

This post will guide you how to use Google Sheets CEILING function with syntax and examples. Description The Google Sheets CEILING function returns a given number rounded up to the nearest multiple of a given number of significance. You can ...

Google Sheets ATANH Function
google sheets atanh function1

This post will guide you how to use Google Sheets ATANH function with syntax and examples. Description The Google Sheets ATANH function returns the inverse hyperbolic tangent of a given number. So you can use the ATANH function to calculate ...

Google Sheets ATAN Function
google sheets atan function3

This post will guide you how to use Google Sheets ATAN function with syntax and examples. Description The Google Sheets ATAN function returns the arctangent of a number. So this function can be used to calculates the arctangent of a ...

Google Sheets ASINH Function
google sheets ASINH function1

This post will guide you how to use Google Sheets ASINH function with syntax and examples. Description The Google Sheets ASINH function returns the inverse hyperbolic sine of a number. The ASINH function is a build-in function in Google Sheets ...

Sidebar