Google Sheets MIDB Function

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

1. Google Sheets MIDB Function Description

The Google Sheets MIDB function returns a substring (a specified number of bytes) starting from the middle of a text string and up to a specified number of bytes.

The MIDB function can be used to extract a given bytes of characters from the middle of a text string in google sheets. It returns a substring from a text string at the position that you specify.

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

2. Google Sheets MIDB Function Syntax

The syntax of the MIDB function is as below:

= MIDB (text, start_num, length_bytes)

Where the MIDB function arguments are:

  • text -This is a required argument. The text string that you want to extract substring from.
  • start_num-This is a required argument.  The position of the first character that you want to extract in text string. The index from the left of text string from which to begin extracting. And the first character in text string is the index 1.
  • length_bytes-This is a required argument.  The number of the bytes that you want to extract from a text string.

Note: 

  • If start_num is greater than the length of text, the MIDB function will return empty text.
  • If start_num is less than 1, the MIDB function will return the #VALUE! Error value.
  • If Length_bytesis negative, MIDB will return the #VALUE!  Error value.
  • If you want to extract a substring from start_num to the end of text string, and you can use the LEN function to calculate the length of the text string, you should not specify a large number to length_bytes argument for this case.
  • If you want to extract a substring beginning with a particular character, and you should use the SEARCH function to get the index of  that character in text string.
  • Length_bytes must be greater than or equal to 0.
  • Start_num must be greater than or equal to 1.
  • If text string has only single bytes characters and the MIDB function returns the same value as MID function.

3. Google Sheets MIDB Function Examples

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

#1 To extract 10 bytes of substring  from the text string in B1, starting at the 5th character, just using the following formula:

=MIDB(B1,5,10)  //it returns “le sheets”
google sheets midb function1

#2 If num_chars value is greater than the length of remaining bytes, and the MID function will return all remining characters:

=MIDB("google",3,200) //it returns “ogle”
google sheets midb function1

#3 if text value is a number, and the returned value is also a text by MID function:

=MIDB(1234,2,2)   //it returns “23”
google sheets midb function1

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 RIGHTB 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 in google sheets.

4. Related Functions

  • Google Sheets LEFT Function
    The 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])…
  • Google Sheets LEN Function
    The Google Sheets LEN function returns the length of a text string (the number of characters in a text string).The syntax of the LEN function is as below:= LEN(text)…

Google Sheets RIGHT Function

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

Description


The Google Sheets RIGHT function returns a substring (a specified number of the characters) from a text string, starting from the rightmost character.

The RIGHT function can be used to extract a given number of characters from the rightmost of a text string in google sheets. It returns a substring from the beginning of a specified string.  It’s purpose is to extract text from the right of a text string.

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

Syntax


The syntax of the RIGHT function is as below:

=RIGHT(text,[num_chars])

Where the RIGHT function arguments are:

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

Note: 

  • The Num_chars value must be greater than or equal to zero. If Num_chars is greater that the length of text string, it will return all of text string. If Num_chars value is omitted, it is set to be 1 by default.
  • If Num_chars is equal to 0, it will cause RIGHT function to extract the empty string.
  • The RIGHT function takes two arguments, text and num_chars. The first argument, text is the string from which the right portion will be returned. And the second argument, num_chars is the number of characters to return from the right side of text.

Google Sheets RIGHT Function Examples


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

#1 To extract the rightmost 4 characters in the B1 cell, just using formula:

=RIGHT(B1,4) //it returns “ogle”

google sheets right function

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

=RIGHT(“google”) //it returns “e”

google sheets right function

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

=RIGHT("google",200)  //it returns “google”

google sheets right function

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

= RIGHT(1234,2) //it returns “34”

google sheets right function

#5 You can also use the RIGHT function in combination with the FIND function to create a complex formula to extract a specific text string. The FIND function will get the position of the given charcter in text string, and the RIGHT function returns all text characters to the right of that position in google sheets.

= RIGHT ("google",FIND("l","google")-1)  //it returns “ogle”

google sheets right function

Note:

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

Google Sheets MID Function

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

Description


The Google Sheets MID function returns a substring (a specified number of the characters) starting from the middle of a text string.

The MID function can be used to extract a given number of characters from the middle of a text string in google sheets. It returns a substring  from a text string at the position that you specify.

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

Syntax


The syntax of the MID function is as below:

= MID (text, start_num, num_chars)

Where the MID function arguments are:

  • text -This is a required argument. The text string that you want to extract substring from.
  • start_num-This is a required argument.  The position of the first character that you want to extract in text string. The index from the left of text string from which to begin extracting. And the first character in text string is the index 1.
  • num_chars-This is a required argument.  The number of the characters that you want to extract from a text string.

Note: 

  • If start_num is greater than the length of text, the MID function will return empty text.
  • If start_num is less than 1, the MID function will return the #VALUE! Error value.
  • If num_chars is negative, MID will return the #VALUE!  Error value.
  • If you want to extract a substring from start_num to the end of text string, and you can use the LEN function to calculate the length of the text string, you should not specify a large number to num_chars argument for this case.
  • If you want to extract a substring beginning with a particular character, and you should use the SEARCH function to get the index of  that character in text string.

Google Sheets MID Function Examples


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

#1 To extract 10 characters from the text string in B1, starting at the 5th character, just using the following formula:

=MID(B1,5,10)  //it returns “le sheets”

google sheets mid function

#2 If num_chars value is greater than the length of remaining characters, and the MID function will return all remining characters:

=MID(“google”,3,200)  //it returns “ogle”

google sheets mid function

#3 if text value is a number, and the returned value is also a text by MID function:

=MID(1234,2,2)

google sheets mid function

Note:

You can use the LEFT 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 MID function in google sheets.

 

Related Functions


  • Google Sheets LEFT Function
    The 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])…

 

 

 

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]) …

 

 

 

 

 

 

 

 

 

Google Sheets LEN Function

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

Description


The Google Sheets LEN function returns the length of a text string (the number of characters in a text string).

The LEN function can be used to count the number of characters for a given text string in google sheets. It also can count characters in numbers, but it will not count the number formatting.

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

Syntax


The syntax of the LEN function is as below:

= LEN(text)

Where the LEN function arguments are:

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

Note: 

  • The LEN function only takes one argument. It counts the number of characters in text string, including space or non-printing characters. If the LEN 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 LEN function returns
  • Len function will also count the characters in numeric value 

Google Sheets LEN Function Examples


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

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

=LEN(B1)

Google sheets len function1

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

=LEN(B2)

Google sheets len function1

#3 Using LEN function to count the number of characters in a text string:

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

Google sheets len function1

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

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

Google sheets len function1

The LEN 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]) …

 

 

 

 

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]) …

 

 

 

 

 

Google Sheets LEFT Function

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

Description


The Google Sheets LEFT function returns a substring (a specified number of the characters) from a text string, starting from the leftmost character.

The LEFT function can be used to extract a given number of characters from the leftmost of a text string in google sheets. It returns a substring from the beginning of a specified string.

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

Syntax


The syntax of the LEFT function is as below:

= LEFT(text,[num_chars])

Where the LEFT function arguments are:

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

Note: 

  • The Num_chars value must be greater than or equal to zero. If Num_chars is greater that the length of text string, it will return all of text string. If Num_chars value is omitted, it is set to be 1 by default.
  • If Num_chars is equal to 0, it will cause LEFT function to extract the empty string.

Google Sheets LEFT Function Examples


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

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

=LEFT(B1,4)

google sheets left function

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

=LEFT(“google”)

google sheets left function

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

=LEFT("google",200)

google sheets left function

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

=LEFT(1234,2)

google sheets left function

#5 You can also use the LEFT function in combination with the FIND function to create a complex formula to extract a specific text string. The FIND function will get the position of the given charcter in text string, and the LEFT function returns all text characters to the left of that position in google sheets.

=LEFT("google",FIND("l","google")-1)

google sheets left function

Note:

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